Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count records in a table meeting criteria 1

Status
Not open for further replies.

bill1one

Programmer
Sep 29, 2004
93
US
The following statement counts all the records in the table. How can I limit it to count only the records where [School] is "Souders"?

SELECT Count(*) AS [Number of Participants]
FROM tblParticipants;
 
SELECT Count(*) AS [Number of Participants]
FROM tblParticipants
WHERE [School] = 'Souders'

r937.com | rudy.ca
 
SELECT Count(*) AS [Number of Participants]
FROM tblParticipants
WHERE [school] = "Souders"
 
For future reference, if you want a count of all schools individually:

SELECT School, COunt(*) As [Number of Participants]
FROM tblParticipants
GROUP BY School

will return data like this:
School Number of Participants
Souders 75
Norders 60
Easters 56
Westers 100



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top