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!

Running Total based on group value

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
I've created the following variable so that it takes the value of a group header as the startqty, then subtracts for each detail, which works great. However, if the group header is say 100 and the detail is 150, I don't want it to show -50 but rather stop when it meets the group header value. Is that possible?

whileprintingrecords;
numbervar StartQty;
numbervar sumdet := sumdet + {table.QtyOut};
StartQty - sumdet
 
Try amending the formula as follows:

Code:
whileprintingrecords;
numbervar StartQty;
numbervar sumdet := sumdet + {table.QtyOut};

If	StartQty - sumdet > 0 
Then	StartQty - sumdet
Else	0

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top