473,406 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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
Sep 4 '06 #1
2 3080

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" <jo**@test.comwrote in message
news:Dt********************@casema.nl...
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


Sep 4 '06 #2
Thanks. That did it!
john

"Terry Kreft" <te*********@mps.co.ukschreef in bericht
news:j8******************************@eclipse.net. uk...
>
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" <jo**@test.comwrote in message
news:Dt********************@casema.nl...
>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



Sep 4 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Steve Heath | last post by:
I have a query that provides detail for sales transactions meeting certain criteria (date, purchase type, etc.) I am creating a report based on that query, and I want to add a summary section. I...
5
by: Terri | last post by:
I have a form with a multi-select combo. I dynamically build a SELECT statement, open a report, and set the recordsource to my dynamic SELECT statement. I count the records returned in the report...
2
by: SJM | last post by:
I have a report that displays records of real estate properties. It is possible for each property to appear a number of times for various reasons. Each record however is unique. What I would like...
3
by: john | last post by:
SELECT DISTINCT Ap2.test1, Count(Ap2.test1) AS AantalVantest1 FROM Ap2 GROUP BY Ap2.test1; gives me a record count per unique value of test1 field. How do I include the count of all the records...
2
by: ericv | last post by:
I have 3500 records in a table - each record has a unique value (KEY_ID field), but some records share the same value (in a field called POLE_ID) So, there may be 3 records that have the POLE_ID...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
1
by: muld | last post by:
I've inherited a database system designed to calculate sickness absence statistics. There is a main table with an employee ID which also holds the number of days worked by that person in a year ....
1
by: dez5000 | last post by:
I'm trying to get a report by location that would list the number of visits to the location for the month but also count the number of unique visitors to that location. I have a table of data with...
12
by: petter | last post by:
Hi! I have two questions: one question that regards the COUNT-function, and one about how to display a month even if I don’t have any data for that month. I have an Access database where I want...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.