calculating running totals

K

KAitchison

i'm trying to calculate some running totals of some fields but i'm having
some problems...

I have a querry that calculates some other things for a table so i tried
inserting:
Running Total Manure: Sum(STA_Amend_Data![Total Yards of Manure Delivered])

and i get an error that says "does not include the specified 'Date' as part
of aggregate function"

I created a different query and just calculated the running total using the
same expression
This did return a value but it was huge compared to the actual running
total...

can someone please give me some insite into where i'm going wrong??
 
K

KARL DEWEY

Can't fix what I don't see. Post the SQL of your 2 queries you mentioned.
Open in design view, click on VIEW - SQL View, highlight all, copy, and
paste in a post.
 
M

Marshall Barton

KAitchison said:
i'm trying to calculate some running totals of some fields but i'm having
some problems...

I have a querry that calculates some other things for a table so i tried
inserting:
Running Total Manure: Sum(STA_Amend_Data![Total Yards of Manure Delivered])

and i get an error that says "does not include the specified 'Date' as part
of aggregate function"

I created a different query and just calculated the running total using the
same expression
This did return a value but it was huge compared to the actual running
total...


Running sums in a query are a pain in that they require a
subquery and can be very slow for a large dataset. The
subquery would be along these lines:

SELECT this,
that,
somedate,
(SELECT Sum(X.num) FROM table As X
WHERE X.somedate < table.somedate) As RunSum
FROM table

If you can use a repot to present the data to users, it
would be a whole lot easier/faster to use a running sum text
box.
 

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