[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 336
  • Last Modified:

Access 2003 Query

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
submarinerssbn731
Asked:
submarinerssbn731
1 Solution
 
PatHartmanCommented:
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
 
SharathData EngineerCommented:
Do you have an identity column defined in your table?
Among the duplicate records, which record you want to keep?
0
 
submarinerssbn731Author Commented:
Great answer!  Thanks!!!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Tackle projects and never again get stuck behind a technical roadblock.
Join Now