[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • 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

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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