Connecting Tech Pros Worldwide Help | Site Map

Count nr of unique group of records

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 4th, 2006, 04:15 PM
john
Guest
 
Posts: n/a
Default Count nr of unique group of records

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



  #2  
Old September 4th, 2006, 04:45 PM
Terry Kreft
Guest
 
Posts: n/a
Default 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
>
>

  #3  
Old September 4th, 2006, 05:05 PM
john
Guest
 
Posts: n/a
Default 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
>>
>>
>
>

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.