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!

manual running totals

Status
Not open for further replies.

Mack2

Instructor
Mar 12, 2003
336
US
I am creating manual running totals. My variable is not resetting to zero when the next group starts. This is my code
in header section
Numbervar RunningTotal;
RunningTotal:= 0
Detail section
Numbervar RunningTotal;
if {PurchaseLines.QtyReceived} = next({PurchaseLines.QtyReceived})
then RunningTotal
else RunningTotal:= RunningTotal + {PurchaseLines.QtyReceived}
Footer Section
Numbervar RunningTotal;
RunningTotal
When I get to the next group the variable has the values from the previous group

Help Please
 
Thank you, that did make a difference. But the totals are not correct for every group that has the same number of withdrawls. If within the same group the number of withdrawls are the same it does not add the second number. I am trying to sort those numbers by using the group sort expert, but it is not sorting them.
Then code I have tryed
WhilePrintingRecords;
Numbervar RunningTotal;
if {PurchaseLines.QtyReceived} = next({PurchaseLines.QtyReceived})
//if {PurchaseLines.itemnid} = next({PurchaseLines.itemnid})
//and {PurchaseLines.ItemNid} = next({PurchaseLines.ItemNid})
then RunningTotal
else RunningTotal:= RunningTotal + {PurchaseLines.QtyReceived}
I hope this makes sense, it is driving me crazy. Thanks for your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top