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

Counting Unique Rows in a table 1

Status
Not open for further replies.

egstatus

Programmer
Apr 14, 2005
143
US
Hi all,
I am trying to count unique rows in a table without having much luck. I want to use a querry, I have tryed DISTINCTROW, COUNT, and DISTINCT without any luck.

This is what the field that I am trying to count looks like:
NHR\20060814\00005\
NHR\20060814\00005\
NHR\20060814\00005\
NHR\20060814\00006\
NHR\20060814\00007\
NHR\20060814\00007\
NHR\20060814\00008\
NHR\20060814\00008\
NHR\20060814\00008\

So I want 3 returned for the record ending with 00005\, 1 for the record ending with 00006\ and so forth.

How do I acomplish this in access, via a querry?

Thanks

Ed Guardado
 
SELECT [the field that you are trying to count], Count(*) As theCount
FROM yourTable
GROUP BY [the field that you are trying to count]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top