I'm trying to create a running totals query in access 97. I have
followed the directions on how to do it from Microsofts website
article id 138911. I took their code they had and replaced it with my
fields. When I try to run it I get #errors in my RunTot column. I'm
kinda new to this. Not sure if maybe I mistyped something wrong or is
there a better way to do this? I have pasted the code. Any help would
be greatly appreciated. Thanks.
SELECT [Quotes & Orders].[Inbound Date], [Quotes & Orders].[Sales
Rep], DatePart("yyyy" ,[Inbound Date]) AS AYear, DatePart("m",[Inbound
Date]) AS AMonth, DSum("Contract Price","Quotes &
Orders","Datepa rt('m',[Inbound Date])<=" & [Amonth] & "And
Datepart('yyyy' ,[Inbound date])<=" & [ayear] & "") AS RunTot,
Format([Inbound Date],"mmm") AS FDate
FROM [Quotes & Orders]
WHERE (((DatePart("yy yy",[Inbound Date]))=[Enter Year]))
GROUP BY [Quotes & Orders].[Inbound Date], [Quotes & Orders].[Sales
Rep], DatePart("yyyy" ,[Inbound Date]), DatePart("m",[Inbound Date]),
Format([Inbound Date],"mmm")
HAVING ((([Quotes & Orders].[Inbound Date]) Is Not Null) AND (([Quotes
& Orders].[Sales Rep])=[Enter Salesman]))
ORDER BY [Quotes & Orders].[Inbound Date], DatePart("yyyy" ,[Inbound
Date]), DatePart("m",[Inbound Date]), Format([Inbound Date],"mmm");
followed the directions on how to do it from Microsofts website
article id 138911. I took their code they had and replaced it with my
fields. When I try to run it I get #errors in my RunTot column. I'm
kinda new to this. Not sure if maybe I mistyped something wrong or is
there a better way to do this? I have pasted the code. Any help would
be greatly appreciated. Thanks.
SELECT [Quotes & Orders].[Inbound Date], [Quotes & Orders].[Sales
Rep], DatePart("yyyy" ,[Inbound Date]) AS AYear, DatePart("m",[Inbound
Date]) AS AMonth, DSum("Contract Price","Quotes &
Orders","Datepa rt('m',[Inbound Date])<=" & [Amonth] & "And
Datepart('yyyy' ,[Inbound date])<=" & [ayear] & "") AS RunTot,
Format([Inbound Date],"mmm") AS FDate
FROM [Quotes & Orders]
WHERE (((DatePart("yy yy",[Inbound Date]))=[Enter Year]))
GROUP BY [Quotes & Orders].[Inbound Date], [Quotes & Orders].[Sales
Rep], DatePart("yyyy" ,[Inbound Date]), DatePart("m",[Inbound Date]),
Format([Inbound Date],"mmm")
HAVING ((([Quotes & Orders].[Inbound Date]) Is Not Null) AND (([Quotes
& Orders].[Sales Rep])=[Enter Salesman]))
ORDER BY [Quotes & Orders].[Inbound Date], DatePart("yyyy" ,[Inbound
Date]), DatePart("m",[Inbound Date]), Format([Inbound Date],"mmm");
Comment