How do I obtain a running sum for ungrouped items?

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

Guest

I need to created a running sum expression in a query, and due to the nature
of the query, cannot group or sort by the selection criteria (the selected
records must be sorted with a different field).
 
On Sat, 29 Jan 2005 16:05:02 -0800, "Skip in Virginia" <Skip in
I need to created a running sum expression in a query, and due to the nature
of the query, cannot group or sort by the selection criteria (the selected
records must be sorted with a different field).

Must this sum be *IN THE QUERY*? It's easy on a Report - set the
Running Sum property of a textbox.

If you need it in a Query, you can use an expression

RunningSum: DSum("[FieldToSum]", "[QueryName]", "[Sortfield] <= " &
[Sortfield])

making appropriate substitutions for fieldnames. There is no
requirement that the fields used as criteria be the same as the fields
used for sorting; I'm not sure why you see this as posing a problem!

John W. Vinson[MVP]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top