query to summarise info from a field

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?
 
S

Sandra Daigle

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.
 

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