counting

  • Thread starter Thread starter Jean-Paul De Winter
  • Start date Start date
J

Jean-Paul De Winter

Hi,

I have a table with about 6000 records.
Most are part of a category (about 20 different ones)
Some don't have a catergory assigned
Can somebody please explain how to create a query that:
Counts the amount of records per category
and
calculates the % this category is assigned (records without a categry
should not be included in the calculation)

Thanks
JP
 
Hi,



SELECT category, COUNT(*), COUNT(*) / ( SELECT COUNT(category) FROM myTable)
FROM myTable
GROUP BY category



should do.



Hoping it may help,
Vanderghast, Access MVP
 

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

Similar Threads


Back
Top