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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count function in ACCESS

Status
Not open for further replies.

ilanaz

Programmer
Joined
Feb 21, 2003
Messages
4
Location
CA
Hi,

I have a database with many names of families with the first name of each member. i'd like to know how many people there is per family. In the Query, I don't know what expression to write.

help anypne please...

ilan.azuelos@mail.mcgill.ca
 
Select Count(LastName), LastName
From YourTableName
Group By LastName
Having LastName Like "S*"
Order By LastName;

The group by is what count uses to match everything up. Whenever you use Group By, everything in your select clause must also be in the Group By.

The Having clause is like a Where clause for Group By. In the example above, it would return all LastNames starting with S.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top