Count schools by district (query)

  • Thread starter Thread starter Perry Kew
  • Start date Start date
P

Perry Kew

I have two fields called District and School. In each
district there are many schools. How can I get a count (in
a query) of the number of schools in each district?

I did a totals query but I am not able to get the answer I
want.

Thanks for any help.

--Perry
 
If you Group by the District field and Count on the School
field you should get the answer you are looking for.
 
Try and SQL statement similar to the following:

SELECT District, Count(School) AS SchoolsPerDistrict
FROM YourTable
GROUP BY District;
 
Perry,

As long as your District and School are both in the same
table maybe try this select query:

SELECT District,Count(District) AS CntOfSchool
FROM tablename
GROUP BY District;

I just did this query a few days ago and it worked for me
and gave me a total count for each different District.
And if you want the Districts in order, you can add an
ORDER BY District after the Group BY District. Hope that
works for you.
 
Back
Top