running sum in a table or query in access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get the cumulative total after each record I enter. I can get
these values using running sum in a report, but I would like to put these
values into a table or query so I can develop them into a chart.
 
I am trying to get the cumulative total after each record I enter. I can get
these values using running sum in a report, but I would like to put these
values into a table or query so I can develop them into a chart.

If you have some strictly-ascending value in the table (such as an
incrementing autonumber or a date/time field defaulting to Now()) you
can use either a subquery or (better, if you want the recordset to be
updateable) DSum() to calculate the running sum:

RunningSum: DSum("[fieldname]", "[tablename]", "[seqfield] <= " &
[seqfield])

will sum across all table records with an equal or lower value of the
sequential field.

John W. Vinson[MVP]
 
Back
Top