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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum Two Fields In A Group

Status
Not open for further replies.

mmck1964

Technical User
Jul 12, 2001
104
US
I am trying to sum two charge amounts that are grouped by their charge code in a report.

Group Header 2 is for the Account
Group Header 3 is for the Charge Codes

In GH3, the charge for Charge Code 71 and the charge for Charge Code 11 are displaying properly, but I want to sum Charge Code 71 and Charge Code 11 for each Account in group Footer 3.

I cannot seem to get the correct combinations of the While Printing Records. below is what I have that is not working:

//GH2
whileprintingrecords;
Global numbervar SumChgAmt:= 0;

//GH3
whileprintingrecords;
numbervar A;
numbervar B;

//GF3
whileprintingrecords;
Global numbervar SumChgAmt:= A + B

Please advise!
Thanks



 
Please explain whether there are other codes besides 11 and 71 in the dataset.

And what is the logic for putting the sum in the group #3 footer? This value would then repeat for each Group #3 footer. I think it belongs in the Account group footer.

Finally, are you able to get the correct sums for each charge code by simply inserting a sum at the Charge Code level? (Need to know to determine what kind of solution to provide for the higher order summary).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top