Question about trying to do a unique count (1 Viewer)

hammerva

Registered User.
Local time
Today, 09:09
Joined
Dec 19, 2000
Messages
102
Hello. First of all cool design of the message board. Anyway here is my question

I am trying to do the following SQL in a query:

Select count (distinct Requirement_Number)
from Quality_Control
Where Status_Number = '3325'

But I keep getting a syntax error trying to run this query. I know that I have used this Distinct thing before in a count outside of Access and it worked. Doesn't work in Access 97.

Any idea what the problem is? And way of figuring out how to work around it.

Thanks for the help :cool:
 

hammerva

Registered User.
Local time
Today, 09:09
Joined
Dec 19, 2000
Messages
102
Nope no luck. I get an error message saying 'Syntax error (missing operator) in query expression "Count (Distinct Requirement_Number)'
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 04:09
Joined
Feb 19, 2002
Messages
43,445
Jet does not support this SQL syntax. You need to use either a sub query or a separate nested query.

query1:
Select distinct Requirement_Number
From Quality_Control
Where Status_Number = '3325';

query2:
Select Count(*) as DistinctRequirements
from query1;
 

Users who are viewing this thread

Top Bottom