Count schools by district (query)

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
 
D

Deb Wolney

If you Group by the District field and Count on the School
field you should get the answer you are looking for.
 
L

Lynn Trapp

Try and SQL statement similar to the following:

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

Laurie

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.
 

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


Top