counting occurrances

  • Thread starter Thread starter Dave Cullen
  • Start date Start date
D

Dave Cullen

How do I create a query that will count the number of unique values in
one column of a table?

For instance, Table PEOPLE:

LASTNAME
Smith
Jones
Smith

Has 2 unique values.

Thanks

drc
 
Dear Dave:

Write a query that gives only the distinct names, then count:

SELECT COUNT(*) FROM (SELECT DISTINCT LASTNAME FROM YourTable) XX

How do I create a query that will count the number of unique values in
one column of a table?

For instance, Table PEOPLE:

LASTNAME
Smith
Jones
Smith

Has 2 unique values.

Thanks

drc

Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
 
Back
Top