select count(distinct(column name)) from table name

G

Guest

hi all
i want to select count of distinct value from table
but message box appear tell me undefined function distinct
select count (distinct(column name)) from table
please help
 
J

John Vinson

hi all
i want to select count of distinct value from table
but message box appear tell me undefined function distinct
select count (distinct(column name)) from table
please help

Access does not support the ANSI standard "Count Distinct" operator.

What you'll need is a Subquery selecting distinct values, and an outer
query counting them:

SELECT ID, Count(*)
FROM (SELECT DISTINCT ID FROM yourtable)
GROUP BY ID;

John W. Vinson[MVP]
 

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