shchuka
asked on
count(distinct) in MS Access
I'm developing an application which is eventually to be ported into Oracle database,
but currently I'm doing debugging with MS Access, since it's easier to setup and verify
what's going on. The problem I encountered is Access doesn't seem to understand
the count(distinct) in the query. In particular, my query is
SELECT COUNT(DISTINCT VarMatrixRow) FROM DecVariables
When running this, I'm getting the error
Syntax error (missing operator) in query expression 'COUNT(DISTINCT VarMatrixRow)'
Of course, I can go around it and write a code to count the number of distinct things in the table,
but that's not very efficient, especially since I'll be moving this to Oracle soon. Any ideas?
but currently I'm doing debugging with MS Access, since it's easier to setup and verify
what's going on. The problem I encountered is Access doesn't seem to understand
the count(distinct) in the query. In particular, my query is
SELECT COUNT(DISTINCT VarMatrixRow) FROM DecVariables
When running this, I'm getting the error
Syntax error (missing operator) in query expression 'COUNT(DISTINCT VarMatrixRow)'
Of course, I can go around it and write a code to count the number of distinct things in the table,
but that's not very efficient, especially since I'll be moving this to Oracle soon. Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
select count(x) from (select (distinct VarMatrixRow) x from DecVariables)
also fails in Access, since Access doesn't understand subqueries.
Thanks anyway.