counting

  • Thread starter Jean-Paul De Winter
  • 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
 
M

Michel Walsh

Hi,



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



should do.



Hoping it may help,
Vanderghast, Access MVP
 
Top