Running total colum in Query

Lanason

Registered User.
Local time
Today, 13:09
Joined
Sep 12, 2003
Messages
258
I'm trying to do a simple running total in a query and finding errors all the time

Its a simple query on another query

RunTot: (DSum([DeldVol],[qrySOLSKUsRunTot]))

DeldVol is the fieldI wish to have a running sum
qrySOLSKUsRunTot = is the current query not the underlying one

I want to use all the data in the current query so I dont need an expression

Whats wrong ??:banghead::banghead::banghead:
 
You can't in a query, but you can in a report.
Set the field property in the report to running sum.
 
Ouch really - I want to calculate "sales to date" on each product line this year v last year and get a trend

Can I do it in a graph ??
 
if you have a pk key in your new query (say ID or something), you can.

SELECT productID, ProductName, Qty, (SELECT SUM(T1.Qty) FROM Product AS T1 WHERE T1.ProductID = Product.ProductID) As [Running Sum] FROM Product
 
Thanks - not sure i understand the fields in your code - what is what??
 
then, what is the name of the table you want to query, the name of pk field, the fieldname that you want to get the running sum, the other fieldnames you want to include in your query?
 
Here's an example. Note each record must have a unique identifier. I've used SalesDate in my example but if you have more that one SalesDate of the same value for a given product then you'll need a different identifier.
 

Attachments

Users who are viewing this thread

Back
Top Bottom