473,322 Members | 1,496 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,322 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 7726
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.