query to summarise info from a field

  • Thread starter Thread starter Adam!
  • Start date Start date
A

Adam!

I have a (number)field in a table that can contain only a 1,2 or 3. I want
to make a query that counts the amount of 1's, 2's and 3's throughout the
records in that field. only know how to display records with a certain
number ie. in criteria "=3"
Is there a count function, and how do I use it for more than one type of
data?
 
Hi Adam,

Sounds like you need a summary query that groups by the field containing 1,2
or 3 and counts the records in each group:

SELECT Count(Field1) AS CountofRecords
FROM tblMyTable
GROUP BY Field2;

Replace "tblMyTable" with your table name, "Field1" with the primarykey
field (or any other field) and replace "field2" with the name of the field
containing the 1,2 or 3.
 
Back
Top