DSUM problem

S

SF

I have

ProductID Qty UP
75 20 4.9
75 30 4.8
77 22 3.9
78 23 4.8




I can query the total quantity of order as below

OrdersOverALL: Nz(DSum("Qty","Orders"),0)

What is the correct syntax to do sum by productID. I cannot get answer from
expression below

OrdersOverALL: Nz(DSum("Qty","Orders","ProductID"=ProductID),0)
 
K

Ken Snell [MVP]

You're very close... put the = sign inside the quotes, and concatenate the
value of the ProductID field into the string:

OrdersOverALL: Nz(DSum("Qty","Orders","ProductID=" & ProductID),0)
 
S

SF

Yes. It works!

Thank you

SF
Ken Snell said:
You're very close... put the = sign inside the quotes, and concatenate the
value of the ProductID field into the string:

OrdersOverALL: Nz(DSum("Qty","Orders","ProductID=" & ProductID),0)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top