Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dsum with AND (.......OR......)

Status
Not open for further replies.

apestaarten

Technical User
Aug 20, 2008
7
NL
I try to use Dsum to sum the ours ill for a particulair location whereby the recover date or the moth still ill are valid for a month.
Here under my code :
Code:
Ziekteuren = DSum("[Aantal uren ziek]", "Verzuim Query1", "[StationID] =" & StationID & " AND (Datepart('m',[Datum herstelmelding]) =" & DatePart("m", Maand) & " OR Datepart('m',[MaandNZ]) =" & DatePart("m", Maand))[\code]

I receive an error 3075.

Can someone help me?

Best recards,
Apestaarten
 




Is this MS Access? In which case you ought to post in one of the many MS Access Forums.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Why not posting the whole error message instead of only the number ?

Anyway, I'd use this:
Ziekteuren = DSum("[Aantal uren ziek]", "Verzuim Query1", "[StationID]=" & StationID & " AND (Datepart('m',[Datum herstelmelding])=" & DatePart("m", Maand) & " OR Datepart('m',[MaandNZ])=" & DatePart("m", Maand)[!] & ")"[/!])

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hallo PHV,
Once more you heave given me the right solution!
Thanks!
Small question, where can I find the rigth syntax or is there a way to see what is missing?
Best regards Apestaarten.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top