473,406 Members | 2,387 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.

Duplicated rows in access table

Hallo

I want to delete duplicate records in an access table. There are more rows with the same data, only the id-nr is different. The table contains 96000 rows but not all the rows have duplicates. I try with a query but no result.
I send an extract of the table.

Can somebody help me!
thanks

Anne
Attached Files
File Type: zip vraag.zip (19.7 KB, 107 views)
Aug 30 '12 #1
8 2793
twinnyfo
3,653 Expert Mod 2GB
Do an aggregate query, with a count on one of the fields that has duplicates. In the criteria, use >1, and it should return all your duplicated rows.
Aug 30 '12 #2
zmbd
5,501 Expert Mod 4TB
There is an Access Query Wizard will build this query for you.
BACK UP YOUR DATA!!!
Once the query is bult, and you VERY sure that only the desired records are being returned, you can then run it as a delete action query.

-z
Aug 30 '12 #3
NeoPa
32,556 Expert Mod 16PB
I would suggest a query that identifies which records are duplicated. Fine so far, but I assume you want to leave one copy behind of each duplicated record. The next step is then to find the ID value, for each set of duplicates, which reflects the lowest value. With this recordset of values you can find a recordset of ID values that are bot duplicated AND are NOT in the previous recordset. This recordset reflects the IDs of all the records you require be deleted.
Aug 30 '12 #4
Hallo

I put the duplicated records in a new table. The next step is: "Is it possible to delete records with sql statement"? looking at table 1 for the id and delete in the data table?
Table1 has the id-number of the duplicate records. Table 2 contains the data. I try it with a delete query but it doesn't works!
thanks
Sep 1 '12 #5
NeoPa
32,556 Expert Mod 16PB
Annetiti:
The next step is: "Is it possible to delete records with sql statement"?
Indeed it is, but that's a separate question. That means you need to ask it in a separate thread as this one has its own question.
Sep 1 '12 #6
zmbd
5,501 Expert Mod 4TB
@NeoPa
NeoPa:
As we're working with the same data... and OP has made an effort perhaps a slight nudge in the right direction? After all... OP was about using a query to accomplish the task

Annetiti:

This doesn't follow in your OP as you wanted a single query to do the work on a given table... what you now have is the question: "How do I delete records in one table that match records in a second table"
Two tables...
tbl_withallofthedata
tbl_deletetheserecords

What ever you do here... MAKE A BACKUP of the tbl_withallofthedata!

Just because I like to reward a good effort: slight nudge... you need a query, show both tables, link, etc...

-
In a answer to your OP, yes a query can manage this...
You will need a query to pull the duplicate records (posts #2 and #3). The wizard isn't elegant, but it works.

You then need to look at this query and make a choice as to which records to keep and what field(s) will allow you do this... date/time fields.... primary keys... but you must have a unique means (post #4) so that you can exclude the records you want to keep create a new query based on the wizard results.

Now once you have a query that shows only the records to delete... then you can run the query as a delete query.

This is not difficult, just a lot of little queries to build or a lot of SQL lines to type.

BACK UP your data... and give it a try and post back the SQL that you created.

-z
Sep 2 '12 #7
zmbd
5,501 Expert Mod 4TB
A fairly indepth reveiw of duplicate records and how to deal with them in a bunch of different ways... some not as I would do; however, a fairly indepth piece:
http://office.microsoft.com/en-us/ac...001034558.aspx

IMHO: this should answer, or point the way to an answer, for just about every question on duplicate records. I know I just picked up a trick or two from it myself!

-z
Sep 2 '12 #8
NeoPa
32,556 Expert Mod 16PB
That really would have worked a lot better if you'd waited for the OP to post the question properly and replied to that Z (as I was trying to indicate is what we expect).

That way, your helpful post would be more likely to be seen by people. As it is, only those looking for something along the lines of the original question are likely to see it, which is a bit of a waste.

You see, we do consider things before we make up rules. They really do benefit everybody involved if you think about it (You, the OP, the site, everybody).
Sep 4 '12 #9

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

Similar topics

8
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source...
3
by: Phil Rutter | last post by:
Hello All, I have about 700 word documents that have 2 tables one is static 4 colums x 5 rows the other is 5 colums x rows ranging from 2 to 100 what i wolud like to do is open the word doc....
3
by: dan graziano | last post by:
Hi, How do you suggest is the best way to check for duplicate rows in an access table. And once one knows if there are duplicates, to remove all but one. In my access table, there are 5...
1
by: dan graziano | last post by:
Hi, I had posted this before and would appreciate any ideas on this. I'm trying to put a "total" for every row in an access table. Unfortunately, some rows have "15+" in the "total" field...
3
by: premmehrotra | last post by:
I am using Access 2000 and Oracle 9.2.0.x on a Windows 2000. I have setup Oracle 9.2 ODBC Driver (I have not yet figured how to set Microsoft's Oracle ODBC driver). I am exporting a table from...
2
by: VMI | last post by:
Assuming I have a datarow (or a datarow collection), would it possible to create an Access table and dump the datarow(s) into that Access table? I wouldn't even need to create the fields in the...
3
by: roy_ware | last post by:
I'm using a VB.Net interface to load an Access table. The relationship is 1 input record to many table rows. The problem is that the first name of the first row is populated for every row on the...
1
by: winzy | last post by:
I have a table in Access which needs updating from an Excel file. Instead of importing the whole Excel like a new table in Acess, how do I do a partial import/update?? For example, Access table...
9
by: krzys | last post by:
Hi! Simple questio - how to add rows to table in Microsoft SQL 2008 Server. I don't mean by executing query (INSERT INTO...), but by clicking on table or something - not by writing query manual....
12
ahmedtharwat19
by: ahmedtharwat19 | last post by:
hi, every one for delete duplicated rows can any one up to us an example to see that because i`m beginning to ms access and i have a problem about that thank you for all abo mroan
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
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
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.