Syntax Error in Count

M

mommio2

Could you please tell me what is wrong with this? I'm a newbie. It says
there is an error on my COUNT. It worked before I put the COUNT and the
parentheses in. THANKS!!!

SELECT COUNT( DISTINCT Customer.id)
FROM Customer INNER JOIN [Order] ON Customer.id=Order.[CUSTOMER$id]
ORDER BY Customer.id;

Mommio2
 
S

Sylvain Lafontaine

If I remember correctly, you cannot use the Distinct keyword inside a count
statement with JET (but you can with other type of sql-server database).
Could you describe what you want to do/achieve exactly?

--
Sylvain Lafontaine, ing.
MVP - Windows Live Platform
Email: sylvain2009 sylvainlafontaine com (fill the blanks, no spam please)
Independent consultant and remote programming for Access and SQL-Server
(French)
 
R

Ray

Try this:

SELECT COUNT( * ) FROM
(SELECT DISTINCT Customer.id
FROM Customer INNER JOIN [Order] ON Customer.id=Order.[CUSTOMER$id]
ORDER BY Customer.id);
 

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