I have a query that contains a list of part number's. There are 4 different part numbers that repeat. How can I make a table or query that totals how many I have of each part number? (Should I be using DCount?)
(1) Taking your advice, I tried this:
SELECT [RTS P/N], Count (RTS P/N) As [Total]
FROM [RTS Schedule]
GROUP BY [RTS P/N]
and i got the following error message: Syntax Error (missing operator) in query expression 'Count (RTS P/N)'.
do you know why this would happen? thank's for responding so quickly!
(2) I also tried playing with it and wrote the following:
SELECT DISTINCT [RTS Schedule].[RTS P/N], DCount("[RTS P/N]","RTS Schedule") AS Total
FROM [RTS Schedule]
GROUP BY [RTS P/N]
Each part number was listed correctly in a column but the 2nd column (that should have been the totals for each part number) just gave the total number of records from the RTS Schedule table. Do you know what I did wrong?
Try either this:
SELECT [RTS P/N], Count([RTS P/N]) As [Total]
FROM [RTS Schedule]
GROUP BY [RTS P/N];
Or this:
SELECT [RTS P/N], Count(*) As [Total]
FROM [RTS Schedule]
GROUP BY [RTS P/N];
Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.