Dsum Syntax Issue (1 Viewer)

Drand

Registered User.
Local time
Today, 17:44
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:44
Joined
Oct 29, 2018
Messages
21,455
Looks fine from here. What makes you say it's a syntax problem?
 

Drand

Registered User.
Local time
Today, 17:44
Joined
Jun 8, 2019
Messages
179
The calculation is returning the zero result from the NZ rather than the total I am looking for from the query.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:44
Joined
Oct 29, 2018
Messages
21,455
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.
 

Drand

Registered User.
Local time
Today, 17:44
Joined
Jun 8, 2019
Messages
179
Sorry. My mistake. It is an error in the query design which is returning a null. Apologies for troubling you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 00:44
Joined
Oct 29, 2018
Messages
21,455
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

Top Bottom