View Full Version : Query inconsistency


venk2ksubbu
11-11-2009, 06:23 AM
Hi All,

The following query works very well in MySQL or Open Office but doesn't work in MS Access. Can someone please point out the changes I need to do ?

select count(distinct snum) from SP

Thanks in advance,
Subbarao

namliam
11-11-2009, 06:32 AM
count(distinct ) is not an option in Access :(

You will need to do a 2 step apprauch doing a disting first in another or sub query, followed by a seperated count query

MSAccessRookie
11-11-2009, 07:15 AM
Hi All,

The following query works very well in MySQL or Open Office but doesn't work in MS Access. Can someone please point out the changes I need to do ?

select count(distinct snum) from SP

Thanks in advance,
Subbarao

I don't believe that you can do that in Access. Try to see if the following does what you want it to:

select distinct snum, count(*) As TotalCount from SP

namliam
11-11-2009, 07:43 AM
select distinct snum, count(*) As TotalCount from SP

Wont give the desired results

MSAccessRookie
11-11-2009, 07:46 AM
Wont give the desired results

I see that now. I misread the intent of the post. It will probably take a SubQuery to achieve what the OP wants.