473,404 Members | 2,195 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,404 software developers and data experts.

How to eliminate duplicate records in a query?

I am trying to generate a query from a table which has multiple dublicate records, but In my query, I only want the duplicate records to show once.
Any idea?
Thanks!
Dec 5 '06 #1
7 7729
ADezii
8,834 Expert 8TB
I am trying to generate a query from a table which has multiple dublicate records, but In my query, I only want the duplicate records to show once.
Any idea?
Thanks!
'In the upper pane of the Query Design Window, right click, then select Properties. Change the Unique Values setting to Yes. A further explanation is given below. NOTE: A Query with Unique Values = Yes is not Updateable!

You can use the UniqueValues property when you want to omit records that contain duplicate data in the fields displayed in Datasheet view. For example, if a query's output includes more than one field, the combination of values from all fields must be unique for a given record to be included in the results.

Hope this helps...
Dec 5 '06 #2
Thanks!
I've tried that but it didnt' work.
My problem is that:
I have a table contain 100 records. The primary key is an autonumber, so there are duplicate records with the same Account# which is what I want.
However, I am trying to generate a querry which only shows one record per Account# , but I have no idea. I've tried to do Delete duplicate record method but it deleted records in my table as well, and I don't want that.
Thanks!
Dec 5 '06 #3
NeoPa
32,556 Expert Mod 16PB
Elaine,

There are two 'unique' options :
1. Unique Records
2. Unique Values
They are equivalent to the SQL Predicates DISTINCTROW & DISTINCT repectively.
What you probably need (as suggested by ADezii) is Unique Values.
For this to work you must only select fields to show which are duplicated.

Is that clear or do you need more explanation?
Dec 5 '06 #4
NeoPa
32,556 Expert Mod 16PB
BTW Both experts (ADezii & Blyxx86) came up with the same answer but executed in different ways. They were both right. (Other Thread)
Dec 5 '06 #5
blyxx86
256 100+
BTW Both experts (ADezii & Blyxx86) came up with the same answer but executed in different ways. They were both right. (Other Thread)
I got called an expert. :)
Dec 6 '06 #6
NeoPa
32,556 Expert Mod 16PB
If it looks like one, and sounds like one, then I'm happy to call it one.
Answering members' questions (correctly ;)) puts you in that category.
Dec 6 '06 #7
MMcCarthy
14,534 Expert Mod 8TB
Thanks!
I've tried that but it didnt' work.
My problem is that:
I have a table contain 100 records. The primary key is an autonumber, so there are duplicate records with the same Account# which is what I want.
However, I am trying to generate a querry which only shows one record per Account# , but I have no idea. I've tried to do Delete duplicate record method but it deleted records in my table as well, and I don't want that.
Thanks!
You can group your records by Account# but you will have to aggregate any other fields.

e.g.
Expand|Select|Wrap|Line Numbers
  1. SELECT Account#, First(Field1), First(Field2), ....etc.
  2. FROM TableName
  3. GROUP BY Account#;
  4.  
This will return the first found value for the other fields.
Dec 7 '06 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Giloosh | last post by:
Hello, i need some help if possible... i have a payments table with over 500 records i want to run a query that searches through the table spotting out any duplicate ID#'s and Dates. So basically...
2
by: Francesco Moi | last post by:
Hello. I've got a 'books' table with 'id', 'name', 'author' and 'isbn' fields. Due to an error, my books are duplicated, so I've got (e.g.): 430 - Moby Dick - Herman Melville - 0192833855...
1
by: Rado | last post by:
Hi All, This might quite simple process for some but I am finding it really difficult to do. What is required is not a standard Duplicate query but a variation on it. For example I have...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
6
by: sara | last post by:
I have a procedure to automate bringing several Excel files into our Access tables, on a daily basis. The problem is that if the user has a problem, and tries to run the import again (maybe 3...
2
by: jmarr02s | last post by:
I don't know what I am doing wrong I get duplicate records when I query Here is my SQL query code: SELECT Utilization_T.Facid, Utilization_T.Year, Utilization_T.Beds, Utilization_T.LicBeds,...
4
by: elainenguyen | last post by:
I am trying to generate a query from a table which has multiple dublicate records, but in the query, I don't want to show the duplicate record. I just want the duplicate records to show only one...
1
by: bhaskar321 | last post by:
Hi all, i am new to access could any one tell me how can i eliminate duplicate records from the query Thanks, Bhaskar
2
by: nethravathy | last post by:
Hi, The following table namely elcbtripselect contains 5147 records.I want to know wether this table contains duplicate records or not. I tried with following query 1)SELECT...
1
by: PerumalSamy | last post by:
Hi I am having table with more 13 lakhs records. I am having duplicate records in it. i need to remove that. I wrote the following query SELECT *
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.