CountDistinct group function?

  • Thread starter Thread starter razor
  • Start date Start date
R

razor

Hi,

How can I write a query to Count the distinct values in a
field?

Is there an aggregate function called "CountDistinct()"
that I can use in the totals row?

Thanks!
Razor
 
No, not in Access.

To achieve the same effect, you need two queries -- one to select the
distinct values, and another to count them. In Access 2000 later, you can
make the first a subquery of the second, as in something like:

SELECT COUNT(*)
FROM
(SELECT DISTINCT
[Your Table].[Your Field]
FROM
[Your Table])
 
Back
Top