Does Access support SELECT Count(DISTINCT fieldname) ... 
Author Message
 Does Access support SELECT Count(DISTINCT fieldname) ...

Does Access support the Count(DISTINCT fieldname) aggregate function?  I'm
getting a "Syntax error: missing operator" error on this line.


Tue, 06 Nov 2001 03:00:00 GMT  
 Does Access support SELECT Count(DISTINCT fieldname) ...

Create a SELECT Query to COUNT([FieldName])
Open SQL View
After the word SELECT enter the word DISTICT


Quote:
>Does Access support the Count(DISTINCT fieldname) aggregate function?  I'm
>getting a "Syntax error: missing operator" error on this line.



Tue, 06 Nov 2001 03:00:00 GMT  
 Does Access support SELECT Count(DISTINCT fieldname) ...
That does not work.  That will give you the count of all the rows not
distinct rows.

Chuck

Quote:


>Create a SELECT Query to COUNT([FieldName])
>Open SQL View
>After the word SELECT enter the word DISTICT



>>Does Access support the Count(DISTINCT fieldname) aggregate function?  I'm
>>getting a "Syntax error: missing operator" error on this line.



Tue, 06 Nov 2001 03:00:00 GMT  
 Does Access support SELECT Count(DISTINCT fieldname) ...
As you have discovered, Access does not support COUNT(DISTINCT
<column-name>).  You can sometimes get the answer you want with two queries:

qryDistinct1:
SELECT DISTINCT MyField FROM MyTable;

SELECT COUNT(*) FROM qryDistinct1;
---
Arvin Meyer

Quote:


>Create a SELECT Query to COUNT([FieldName])
>Open SQL View
>After the word SELECT enter the word DISTICT



>>Does Access support the Count(DISTINCT fieldname) aggregate function?  I'm
>>getting a "Syntax error: missing operator" error on this line.



Tue, 06 Nov 2001 03:00:00 GMT  
 Does Access support SELECT Count(DISTINCT fieldname) ...
Oto --
        Are you SURE about that syntax? "SELECT fieldname,
COUNT(fieldname) FROM tablename GROUP BY fieldname" gives counts for
each distinct value of fieldname; putting DISTINCT into it doesn't
change anything.  Or are you trying to eliminate duplicate records
before doing the counting or something else?
HTH, Roger
Quote:
>Does Access support the Count(DISTINCT fieldname) aggregate function?
I'm
>getting a "Syntax error: missing operator" error on this line.



Fri, 09 Nov 2001 03:00:00 GMT  
 Does Access support SELECT Count(DISTINCT fieldname) ...
You cannot use the Count(DISTINCT fieldname) syntax, Jet SQL
does not support it.

--

Michael

-------------------------------
random junk of dubious value is at:
http://www.trigeminal.com


.

Quote:
> Oto --
> Are you SURE about that syntax? "SELECT fieldname,
> COUNT(fieldname) FROM tablename GROUP BY fieldname" gives
counts for
> each distinct value of fieldname; putting DISTINCT into it
doesn't
> change anything.  Or are you trying to eliminate duplicate
records
> before doing the counting or something else?
> HTH, Roger
> >Does Access support the Count(DISTINCT fieldname)
aggregate function?
> I'm
> >getting a "Syntax error: missing operator" error on this
line.



Fri, 09 Nov 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Does Access support SELECT Count(DISTINCT fieldname) ...

2. Why does SELECT COUNT(DISTINCT price) .. not work

3. select count distinct doesnt work

4. select count(distinct field)

5. Microsoft Access SQL: Distinct Count?

6. count( distinct col ) in Access ?

7. SELECT DISTINCT IN POCKET ACCESS

8. SELECT DISTINCT yields more than SELECT

9. Change SELECT to SELECT DISTINCT?

10. SELECT works, but SELECT DISTINCT fails

11. Distinct Count on a Field?

12. "Count distinct"

 

 
Powered by phpBB® Forum Software