Getting an error with Dsum function in Subform (1 Viewer)

sandya

Registered User.
Local time
Today, 19:42
Joined
Oct 27, 2013
Messages
82
Hello friends, can anyone solve my issue

How to use Dsum Function? Am using below following Dsum functions but they are not working and shown an error result. I have attached the screenshot can you please replay how to use dsum in this case?

=Nz(DSum("[Liters]","[SRB_SubformQry]","[Category]=MILK"),0)
=Nz(DSum("[Liters]","[SRB_SubformQry]","[Category]='MILK'"),0)
=Nz(DSum("[Liters]","[SRB_SubformQry]","[Category]<>MILK"),0)

Thanks,
Sandhya.
 

Attachments

  • Dsum (Error).jpg
    Dsum (Error).jpg
    74.7 KB · Views: 90

plog

Banishment Pending
Local time
Today, 09:12
Joined
May 11, 2011
Messages
11,658
In your criteria argument you are doing numerical comparison, you need to do text comparison. that means adding single quotes around the text value you are comparing it to:

"[Category]=MILK"

Should be:

"[Category]='MILK'"
 

sandya

Registered User.
Local time
Today, 19:42
Joined
Oct 27, 2013
Messages
82
Yes, its working... But it's taken only rounded numbers... decimals are did't not count.. i need to count both of rounded numbers & in decimals digits also...
 

Users who are viewing this thread

Top Bottom