Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

correct this formula?

Status
Not open for further replies.

pollux0

IS-IT--Management
Mar 20, 2002
262
US
I am new to coding in cryst. rep.

I want to create a formula similar to this SQL statement:

total = Sum(debitAmount) where {journalEntry.accountIdNumber} = {account.accountIdNumber}
 
Set your table join to accomplish:

{journalEntry.accountIdNumber} = {account.accountIdNumber}

Then create a group for:
account.accountIdNumber

Drop the {debitAmount} field in the detail, right click it and select insert summary and use sum. Now delete the {debitAmount} field.

You can also use a Running Total to do this.

-k kai@informeddatadecisions.com
 
If you're unable to join on these two fields, you could still accomplish this by using formulas:

//Start//
whileprintingrecords;
numbervar total;

if {journalEntry.accountIdNumber} = {account.accountIdNumber}
then total := total + {debitAmount}
else total;
//End//

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top