Sum Quantity by Product

G

Guest

I'm using a DSum function to provide total quantities by product id. The
function is providing the GRAND total of quantities, and not the quantities
by product id. Can anyone spot anything wrong?

SELECT GL_PROD_ID, Quantity,
DSum("Quantity","tblShipOrders_Detail_Crosstab","GL_PROD_ID = " &
'GL_PROD_ID') AS Ttl_Qty
FROM tblShipOrders_Detail_Crosstab
ORDER BY GL_PROD_ID;
 
A

Allen Browne

No need for the DSum():
SELECT GL_PROD_ID, Sum(Quantity) AS Ttl_Qty
FROM tblShipOrders_Detail_Crosstab
ORDER BY GL_PROD_ID;
 

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