Running total in query not grouping by selection

G

Greg

I have the following running total in a query works fine but I need the
Running total to work on the selected Data. When I enter the Control critera
I get the running total of the whole table. I need it to give me a running
total for only the selected records.

Can anyone help with this...



RunTotal: Format(DSum("Minutes","subtable","[Control]<=" & [ContAlias] & "
"),"0000.0",0)
 
J

John Vinson

I have the following running total in a query works fine but I need the
Running total to work on the selected Data. When I enter the Control critera
I get the running total of the whole table. I need it to give me a running
total for only the selected records.

Can anyone help with this...

You need criteria (in the form of a valid SQL WHERE clause without the
word "WHERE") as the third argument to DSum. You don't say what the
selected data might be, but try something like

RunTotal: Format(DSum("Minutes","subtable","[Control]<=" & [ContAlias]
& " AND <whatever other criteria>"),"0000.0",0)


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

Top