Solved

Access 2003 Query

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access query with left expression 5 30
Syntax Error in Query 7 30
Query to summarise data Like Pivot Table 3 29
Open CSV, modify and save as xls from Access 12 19
This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.

920 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

13 Experts available now in Live!

Get 1:1 Help Now