Here is what I use:
SUBROUTINE RUNNING_TOTAL(CUR.TOT, AM.PTR, AMT, RESET.DATA)
* RUNNING_TOTAL Keeps a Running Total for Reports
* by David A. Green -- 9/12/01
*
COMMON /RUNTOT/ RUNTOT.REC(10)
*
EQUATE RUNTOT.FLAG TO RUNTOT.REC(1)
EQUATE RUNTOT.TOTS TO RUNTOT.REC(2)
EQUATE RUNTOT.LAST TO RUNTOT.REC(3)
*
TEST.FLAG = @DATE:@TIME
*
IF TEST.FLAG # RUNTOT.FLAG THEN
RUNTOT.FLAG = TEST.FLAG
RUNTOT.TOTS = ""
RUNTOT.LAST = ""
END
*
IF RESET.DATA # RUNTOT.LAST<AM.PTR> THEN
RUNTOT.LAST<AM.PTR> = RESET.DATA
RUNTOT.TOTS<AM.PTR> = 0
END
*
RUNTOT.TOTS<AM.PTR> += AMT
CUR.TOT = RUNTOT.TOTS<AM.PTR>
*
RETURN
Your formula for the I-Descriptor is:
SUBR("RUNNING_TOTAL", n, Dict_Name, Reset_Dict_Name)
Where n is a unique number for the Query statement, so you can have more
than one running total per query.
Dict_Name is the Dictionary Name to use for Totalling.
Reset_Dict_Name is the Dictionary Name for 'Zeroing out' the Totals when it
changes values. If you don't wish to 'Zero out' the totals then use "".
Note: The reset option only works on presorted data!
Technical:
Running Total supports Multi-Values. For optimal performance use smaller
unique numbers like 1, 2, etc.
David A. Green
(480) 813-1725
DAG Consulting
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Wjhonson
Sent: Monday, July 01, 2013 5:36 PM
To: [email protected]
Subject: [U2] Running total
Teach me again how to do a running total in a Access/Recall/English report.
I haven't done one in years, but I seem to recall that it's possible.
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users