Solved

Access 2003 Query

Posted on 2014-03-18
3
313 Views
Last Modified: 2014-03-19
I have this table in Access 2003 that has several thousand duplicates.  I need a query that will remove the duplicates but leave a record for each PSINO and one record of the PSINO for each period from 168 to 180.
0
Comment
Question by:submarinerssbn731
3 Comments
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39938122
You are not going to be able to do this with just a query unless you have some way of separating the wheat from the chaff.  The simplest method, is to copy the table structure only but not data to create a new empty table.  Open the empty table and define the unique key that will prevent future duplicates.  Then create an append query that copies the data from the original table to the new one.  You will get an error message that tells you that some records are not copied because they would create duplicates.  This is OK.  The preceding method assumes that you don't' care which of the duplicates gets saved.  If you care, you will need to somehow identify which ones you want to keep and then append only those.  I think the last two requests should be satisfied by simply removing the duplicates unless they would create new duplicates themselved.
0
 
LVL 40

Expert Comment

by:Sharath
ID: 39938656
Do you have an identity column defined in your table?
Among the duplicate records, which record you want to keep?
0
 

Author Closing Comment

by:submarinerssbn731
ID: 39939256
Great answer!  Thanks!!!
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now