Dsum Syntax Issue

Drand

Registered User.
Local time
Tomorrow, 07:40
Joined
Jun 8, 2019
Messages
179
Hi Folks

Could someone kindly help me with the syntax for the following?

AccLYJan = Nz(DSum("SumofAmount", "QryExpensesSumByMonthYear", "ExpMonth = 'Jan' And ExpType = 'Accounting'"), 0)

Both criteria are strings and I just cannot get it right!

Many thanks
 
Looks fine from here. What makes you say it's a syntax problem?
 
The calculation is returning the zero result from the NZ rather than the total I am looking for from the query.
 
The calculation is returning the zero result from the NZ rather than the total I am looking for from the query.
Are you saying if you remove the Nz() part, then you get nothing? Also, if you're getting 0, then it can't be a syntax error.
 
Sorry. My mistake. It is an error in the query design which is returning a null. Apologies for troubling you.
 
Sorry. My mistake. It is an error in the query design which is returning a null. Apologies for troubling you.
Glad to hear you got it sorted out. Good luck with your project.
 

Users who are viewing this thread

Back
Top Bottom