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

COUNTIF In Access

Status
Not open for further replies.

amourdevin

Technical User
Sep 7, 2003
21
US
I was wondering if there is a way that you can have MS Access count the number of times a given value appears in an entire field. In MS Excel, I would use the COUNTIF function.

An example would be if you were a widget repairmen and wanted to display how many time a certain serial number widget had been in for repair. I do not mean a query to diplay the history for that serial number but a way to display the actual number of visits as a value (e.g., 2 visits, 5 visits, etc.).
 
Select SerialNumber, Count(SerialNumber) As Visits
From tbl
Group BY SerialNumber

Will show you one entry for each SerialNumber followed by the number of times that SerialNumber occurs in the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top