Running total ..Pls help

N

Noreen

I have a query in which I need to calculate running totals on a no. of
fields, mainly Year To Date figures. The problem is my year includes the
31/12/07. My existing code is below, I need to modify it to include the last
day of last year. Any ideas??


INSERT INTO Blank2 ( [Date], StoreId, RunTotLYRT, Company )
SELECT QueryCOMB.Date, QueryCOMB.StoreId, (SELECT SUM([LY Read Total])
FROM QueryCOMB Q2
WHERE Q2.[Date] <= QueryCOMB.[Date]
AND Year(Q2.[Date]) = Year(QueryCOMB.[Date])
AND Q2.StoreID = QueryCOMB.StoreID) AS RunTotLYRT, QueryCOMB.Company
FROM QueryCOMB
WHERE (((QueryCOMB.Date)=[Enter week end Date]) AND
((QueryCOMB.StoreId)="eyre square"))
ORDER BY QueryCOMB.Date;
 

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