Getting a count of different fields

M

Mr. T.

Hi,

i have a table with records that are in a category. For
example the categories are Company, University, Other. I
have several hundreds of records in the table, and now i
need a report that says to me there were n records in the
category Company, n in the category University and n in
the category Other.

Can anyone give me a clue on how to start doing this?

Regards,

Thomas L.
 
C

Cheryl Fischer

Mr. T,

The first thing you need to do is create a query that will count those
records by Category. You will need to use a Grouping. Here is a sample of
some code that may help get you started.

SELECT MyTable.Category, Count(*) AS CategoryTotal
FROM MyTable
GROUP BY MyTable.Category

To use the above in the design view of a new query, click View on the query
design menu, then select View SQL. Paste the above in the space provided
and edit where necessary to supply the correct name for your table and
fields.

hth,
 

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