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
 

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