Link to home
Start Free TrialLog in
Avatar of miklesw
miklesw

asked on

SELECT Count(distinct field1) FROM table1 WHERE etc etc in MS Access

Is there a way of doing this in 1 query (to be used as a sub query)??? I found this example for MS SQL..

I need the count of unique values for a field...
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of miklesw
miklesw

ASKER

This is a Column in a query:

OptionValuecount: (SELECT Count(OV) AS countofvalues FROM (Select Distinct SQO2.standardquestionid as stdqid, SQO2.optValue as OV from standardquestionoptions as SQO2) WHERE stdQID=[standard questions].standardquestionid)

Tnx

I had tried that, but access was crashing for me... I just had to move the WHERE condition outside the SELECT DISTINCT query...

seems like access doesn't support refering to a parent value from the 2nd sub-query