Can Access do COUNT(DISTINCT .... )?
I'm working on a project using an Access back end, and for the life of me I cannot get it to accept a COUNT(DISTINCT Anything) query. Is this unsupported in Access or is there something wrong with my syntax? When I do a simple count, it works fine.
Here's the query I'm trying to send (I pulled it out of the immediate window so it's actually readable).
SELECT LivingSituations.Description, COUNT(DISTINCT Relationships.ProtegeID) AS NumberProteges
FROM Relationships INNER JOIN (LivingSituations INNER JOIN RelationshipReview ON LivingSituations.LivingSituationID = RelationshipReview.LivingSituation) ON Relationships.RelationshipID = RelationshipReview.RelationshipID
WHERE (((RelationshipReview.ReviewID)=1))
GROUP BY LivingSituations.Description;
[803 byte] By [
Comintern] at [2007-11-19 23:59:11]

# 1 Re: Can Access do COUNT(DISTINCT .... )?
I am not completely sure, but I think this ( http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_20806566.html) can help you out.
EDIT: Funny, now that page hides the replies.?!!?!
# 2 Re: Can Access do COUNT(DISTINCT .... )?
That looks like my issue, but I'm not an Expert's Exchange member anymore. I signed up a while ago and and found that the quality of the answers I was getting was a lot lower than on the open forums (go figure). Can you give me a quick summary or point me in the right direction?
# 3 Re: Can Access do COUNT(DISTINCT .... )?
Here ( http://64.233.167.104/search?q=cache:Qt2whCTjqV4J:www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/VB_Databases/Q_20806566.html+access+count+distinct&hl=en&gl=us&ct=clnk&cd=1) is Google's cache of that page. This has the replies.
EDIT: I FIXED THE LINK!
# 4 Re: Can Access do COUNT(DISTINCT .... )?
Yep, that's what I was afraid of. I'll have to nest two SELECTs. Thanks!
BTW, nice trick going for the cache--I never would have thought of that.
# 5 Re: Can Access do COUNT(DISTINCT .... )?
BTW, nice trick going for the cache--I never would have thought of that.
Thanks, I do have flashes of brilliance once a year. I was just hoping to save it for my wedding in 10 days!:D