Sum duplicate lines in a table

N

Neil

I have a table which contains a list of products soted by poduct name.
Against each product there is a stock quantity, each Item may appear more
than once.
I want to be create a query which will give me a list of the products, but
with only one entry per item, with a total quantity for each item.

Is this possible?

Thanks
 
P

PieterLinden via AccessMonster.com

Neil said:
I have a table which contains a list of products soted by poduct name.
Against each product there is a stock quantity, each Item may appear more
than once.
I want to be create a query which will give me a list of the products, but
with only one entry per item, with a total quantity for each item.

Is this possible?

Thanks

Use a totals query

SELECT ProductID, ProductName, Sum([StockQty])
FROM MyTable
GROUP BY ProductID, ProductName
ORDER BY ProductID, ProductName
 

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

Top