Running total

Badvoc

Registered User.
Local time
Today, 15:35
Joined
Apr 22, 2009
Messages
69
I have the query below working but I need to modify it to only calculate fields where the Approval field in my table is null or empty, I have tried adding the Approval field to the query but the DSum just ignores it, I think the Approval field has to be part of the DSum critiera

Code:
RunTot: DSum("[Days of work required]","tblmaster","DatePart('m', [Assigned Date])<=" & [AMonth] & " And  DatePart('yyyy',  [Assigned Date])<=" & [AYear] & "")
I want to restrict the above to a field in the table called Approval (which is text, ie names)
Something like this
Code:
RunTot: DSum("[Days of work required]","tblmaster","DatePart('m', [Assigned Date])<=" & [AMonth] & " And  DatePart('yyyy',  [Assigned Date])<=" & [AYear] & " and [Approval]="" & "")
Im missing something here.

Iv added SQL of the whole query:
SELECT DatePart("yyyy",[Assigned Date]) AS AYear, DatePart("m",[Assigned Date]) AS AMonth, DSum("[Days of work required]","tblmaster","DatePart('m', [Assigned Date])<=" & [AMonth] & " And DatePart('yyyy', [Assigned Date])<=" & [AYear] & "") AS RunTot, Format([Assigned Date],"mmm") AS FDate
FROM tblmaster
WHERE (((DatePart("yyyy",[Assigned Date]))=2010))
GROUP BY DatePart("yyyy",[Assigned Date]), DatePart("m",[Assigned Date]), Format([Assigned Date],"mmm")
ORDER BY DatePart("yyyy",[Assigned Date]), DatePart("m",[Assigned Date]), Format([Assigned Date],"mmm");

Thanks
 

Users who are viewing this thread

Back
Top Bottom