Connecting Tech Pros Worldwide Forums | Help | Site Map

Count nr of unique group of records

john
Guest
 
Posts: n/a
#1: Sep 4 '06
I have a table with 5 fields. In a query I would like to make a count for
every unique combination of field 2,3, and 4. I fiddled with the count and
dcount option, but can't get it to work for more than one field. Next
question is if it's possible in such a query to show only those unique
combinations that have a count higher than 5.
Thanks,
john



Terry Kreft
Guest
 
Posts: n/a
#2: Sep 4 '06

re: Count nr of unique group of records



SELECT DISTINCT F2, F3, F4
FROM Table6

Will give you the unique combinations of the three fields.

And
SELECT DISTINCT F2, F3, F4
FROM Table6
GROUP BY F2, F3, F4
HAVING Count(*)>5;

Will give you the unique combinations of 3 fields where there are more than
5 records with that combination.


--

Terry Kreft


"john" <john@test.comwrote in message
news:Dt2dneANRLqwyWHZRVnyvw@casema.nl...
Quote:
I have a table with 5 fields. In a query I would like to make a count for
every unique combination of field 2,3, and 4. I fiddled with the count and
dcount option, but can't get it to work for more than one field. Next
question is if it's possible in such a query to show only those unique
combinations that have a count higher than 5.
Thanks,
john
>
>

john
Guest
 
Posts: n/a
#3: Sep 4 '06

re: Count nr of unique group of records


Thanks. That did it!
john

"Terry Kreft" <terry.kreft@mps.co.ukschreef in bericht
news:j8ednUgycMqnxmHZnZ2dnUVZ8smdnZ2d@eclipse.net. uk...
Quote:
>
SELECT DISTINCT F2, F3, F4
FROM Table6
>
Will give you the unique combinations of the three fields.
>
And
SELECT DISTINCT F2, F3, F4
FROM Table6
GROUP BY F2, F3, F4
HAVING Count(*)>5;
>
Will give you the unique combinations of 3 fields where there are more
than
5 records with that combination.
>
>
--
>
Terry Kreft
>
>
"john" <john@test.comwrote in message
news:Dt2dneANRLqwyWHZRVnyvw@casema.nl...
Quote:
>I have a table with 5 fields. In a query I would like to make a count for
>every unique combination of field 2,3, and 4. I fiddled with the count
>and
>dcount option, but can't get it to work for more than one field. Next
>question is if it's possible in such a query to show only those unique
>combinations that have a count higher than 5.
>Thanks,
>john
>>
>>
>
>

Closed Thread