DSum multiple criteria

hillbilly

New member
Local time
Today, 20:48
Joined
Apr 4, 2022
Messages
2
Hello guys, I try since hours to get this query running:

DSum("GewichtungBereich";"qryReportGattungBereiche";"IDB=" & [IDB] & " Und IDG=" & [IDG])

I'm thankfull for any advice! Cheers
 
Hi. Welcome to AWF!

Maybe try using "AND" instead. Just a guess...
Code:
DSum("GewichtungBereich";"qryReportGattungBereiche";"IDB=" & [IDB] & " AND IDG=" & [IDG])
 
Thanks for the welcome! It did work (my access runs in german, so mosty 'Und' instead of 'AND' works, but I better continue with english grammar! Thank you very much and greetings from snowy Switzerland
 
Thanks for the welcome! It did work (my access runs in german, so mosty 'Und' instead of 'AND' works, but I better continue with english grammar! Thank you very much and greetings from snowy Switzerland
Hi. Glad to hear you got it sorted out. Good luck with your project. I wasn't sure if code works in other languages too. Cheers!
 
Here is a debugging hint:
When you have to construct strings, use a variable to hold them. That way, if there is a problem, you can add a stop in the code and print the string to the debug window. You will almost always see the error:)
Code:
strWHERE = "IDB=" & [IDB] & " AND IDG=" & [IDG]
DSum("GewichtungBereich";"qryReportGattungBereiche"; strWHERE)
 

Users who are viewing this thread

Back
Top Bottom