Running Sum of each Detail Record how?

  • Thread starter Thread starter Rog
  • Start date Start date
R

Rog

What I am trying to do is keep a running talley of each
detail record. How can I do this?

Here is an example of what I am trying to do...

Date1
Name1 Goal Actual Name3 Running sum (Actual - Goal)
Name2 Goal Actual Name2 Running sum (Actual - Goal)
Name3 Goal Actual Name3 Running sum (Actual - Goal)
Name4 Goal Actual Name4 Running sum (Actual - Goal)

Date2 This sum carries over from
above for each name....
Name1 Goal Actual Name3 Running sum (Actual - Goal)
Name2 Goal Actual Name2 Running sum (Actual - Goal)
Name3 Goal Actual Name3 Running sum (Actual - Goal)
Name4 Goal Actual Name4 Running sum (Actual - Goal)

etc...
 
You're after a progressive total difference for each name in a report
grouped by dates.

It might be easiest to do this by adding a calculated field to the query the
report is based on. Something like this:

RunningDiff: ( SELECT Sum([Actual] - [Goal]) FROM MyTable As Dupe
WHERE (Dupe.Name = MyTable.Name) AND (Dupe.Date <= MyTable.Date) )
 
Back
Top