Count distinct with SQL

  • Thread starter Thread starter Anders Nielsen
  • Start date Start date
A

Anders Nielsen

Hi NG :-)

According to the best of my knowledge this should work fine:

SELECT COUNT (DISTINCT name) FROM MyTable

But it doesn't...

What is wrong??
And even more interesting: Is there another way to count the number of
distinct names??

Any help will be much appreciated :-)

Best regards
Anders
 
Hi,


SELECT COUNT(*) FROM ( SELECT DISTINCT name FROM myTable)


should do, in Jet.


Hoping it may help,
Vanderghast, Access MVP
 
Hi Michel :-)

Thank you very much :-)

Actually, I figured it out by my self before I saw your post.... But who
will believe that now?? ;-)

best regards
Anders
 
Back
Top