Avatar of AndyC1000
AndyC1000

asked on 

How to use 'Count' in Access for a field of type string

Dear All,

I have a table with the following fields.  I'm trying to count the number of times the same string appears in ItemID, the same string in ModelID for each LocationID.

ID (Number)
ItemID (String)
LocationID (Number)
ModelID (String)

I've tried:

SELECT Count([Table1].ItemID) AS ItemCount, Count([Table1].ModelID) AS ModelCount, [Table1].LocationID
FROM 
(SELECT DISTINCT [Table1].LocationID FROM  [Table1] );

Open in new window




The error states Query does not include LocationID as part of Aggregate function.  

Thanks
Microsoft Access

Avatar of undefined
Last Comment
Rey Obrero (Capricorn1)

8/22/2022 - Mon