Using DSum in Expression Builders (1 Viewer)

freightguy

Registered User.
Local time
Today, 05:27
Joined
Mar 1, 2016
Messages
36
Hi, been a while since my last visit. Hope everyone is well.

I'm having a problem with the following DSum code in a form footer.

Problem: DSum works if there is at least one record that meets the criteria and calculation is fine. However the problem is when no record meets this criteria. The result should be "0.00" or "0" but the textbox result is blank. (the cost field is a currency field)

=DSum(Nz("[Cost]"),"[qryBOMDetail]","[Origin]<>'CA'and [Origin]<>'US' and [Origin]<>'MX'")

thanks in advance
 

plog

Banishment Pending
Local time
Today, 07:27
Joined
May 11, 2011
Messages
11,613
Put the NZ outside of the DSum
 

freightguy

Registered User.
Local time
Today, 05:27
Joined
Mar 1, 2016
Messages
36
very much appreciated!
 

Users who are viewing this thread

Top Bottom