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

how do I sum a variable that uses a sum function 3

Status
Not open for further replies.
Mar 10, 2004
53
US
Hi,

I know that you can't sum a variable that is using a sum function. What's the workaround for this?

Basically have a report that looks like


GH#1 John Doe Paycode HrsWorked Wage Amt
GF#2 Regular Hours 8.0 $80.00
Overtime Hrs 1.0 $15.00
GF#1 Total Hours 9.0 ????

The HrsWorked is a formula that is sum(@hrsworked,{mytable.paycode}), Wage Amt is also a formula that uses HrsWorked.

How do I go about creating a formula that sums up the wage amounts for all the paycodes? The formula Wage Amt is also not showing up as a report field.

Any help is greatly appreciated.
 
In the details section, right click the wage amount field and select insert summary, and choose group 1. Repeat the procedure for group 2.

No formulas required at all.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
You could use the three-formula method:

//{@reset} to be placed in Group Header 1:
whileprintingrecords;
numbervar sumwage := 0;

//{@accumwage} to be placed in Group Footer 2:
whileprintingrecords;
numbervar sumwage := sumwage + {@wageamt};

//{@displaysumwage} to be placed in Group Footer 1:
whileprintingrecords;
numbervar sumwage;

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top