Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to have query display only one of repeating record 2

Status
Not open for further replies.

TekkieDave

Technical User
May 22, 2002
98
US
I looked around but I didn't find any similar posts.

OK, MS ACCESS database -- I got a rather complex query that is pulling info from other tables and queries. The data it's display is correct, but due to the nature of one of the queries it is referencing, it is showing the same data over and over again (correctly). Here is an example:

Employee Name | Vacation days | etc
John Smith | 10 | blah
John Smith | 10 | blah
John Smith | 10 | blah
bob Jones | 4 | yaddah
bob jones | 4 | yaddah
bob jones | 4 | yaddah


How can I get the query to display just one instance of each repeating record? This would help my reporting greatly.

**Okay, have you tried rebooting the machine?**
 
SELECT DISTINCT blah blah

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
SELECT DISTINCT EmployeeName, Vaction Days, etc ....

Leslie
 
I forgot to mentiont that I'm a total Access noob :(

OK, so I added the following into the criteria on a column in the query:

"«Expr»Select Distinct [Employee Name] «Expr»"

The only problem is that it returns 0 records.

Since I have the one query that lists all the dupes, I tried creating another query that pulls the distinct from the 1st query, but to no avail.

thanks for the help so far guys.

-David

**Okay, have you tried rebooting the machine?**
 
I should also mention that from this table:
Employee Name | Vacation days | etc
John Smith | 10 | blah
John Smith | 10 | blah
John Smith | 10 | blah
bob Jones | 4 | yaddah
bob jones | 4 | yaddah
bob jones | 4 | yaddah

my goal is to display:
Employee Name | Vacation days | etc
John Smith | 10 | blah
bob Jones | 4 | yaddah

thought this might clarify.

-D


**Okay, have you tried rebooting the machine?**
 
thanks for your help guys. I figured out though, that in the query's properties, I could set "UniqueRecords" to yes, and the query behaved just like I hoped it would. Thanks for your help!!

:)

**Okay, have you tried rebooting the machine?**
 
one query that lists all the dupes
In the property sheet of this query, set distinct values to yes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top