Solved

Access 2003 Query

Posted on 2014-03-18
3
317 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 35

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

832 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