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
 
Back
Top