Counting question

  • Thread starter Thread starter Jerry
  • Start date Start date
J

Jerry

I have a table of last names and there are several
duplicates. I want to count the number of different last
names appearing in the table, so that the following

Smith
Smith
Jones
Webber
Wallace
Jones

would return a count of 4.

Can you help? Thanks in advance.
 
Try something along the lines of
SELECT Count([LastName]) FROM
(SELECT DISTINCT [LastName] FROM YourTable)

Hope This Helps
Gerald Stanley MCSD
 
There may be an easier way to do this, but this is one way to do it. Create a query based on the table with the last name field in it. The last name field should have "group by" displayed in the sumation line. Then create a second query based on the first query (not the table) with "count" displayed in the sumation line.

This will work; I tried it. But there may be an easier way

Crystal
 

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

Back
Top