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;
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;