counting occurrances

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
 
T

Tom Ellison

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top