If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Formula Issues Debits minus Credits

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-04-09, 10:33
clynniek clynniek is offline
Registered User
 
Join Date: Aug 2009
Posts: 1
Question Formula Issues Debits minus Credits

Hello. I have a SQL database tied to Crystal Reports 2008. I am trying to create a balance sheet and struggling with some formulas.

I have the following fields:

Acct Number
Description
Amount
DC (Debits/Credits)

What I need is a sum of the "D" amounts (which are the debits) minus the sum of the "C" amounts (which are the credits) for a total amount per account number.

Any help would be greatly appreciated. I am a newbie at Crystal Reports. I have used MS Access but this package is new for me.

Thank you.
Reply With Quote
  #2 (permalink)  
Old 08-04-09, 14:35
trowe trowe is offline
Registered User
 
Join Date: Dec 2004
Location: Connecticut
Posts: 85
Since Debits and Credits appear in the same field, you have to separate them. You'll have to make a calculated field for both Debits and Credits that look something like this:

Debits: IF {DC} = "D" THEN {Amount} else 0

Credits: IF {DC} = "C" THEN {Amount} else 0

(My syntax is always wrong since I switch back and forth between MSAccess and Crystal - use the Builder to confirm your syntax)

Once you have Debits and Credits separated, you can summarize them and use them in other calculations.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On