removing duplicate through a loop

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm trying to write something that takes the results of a table e.g.
"Enrolments" and if the record 1 = record 2 then delete record 2.
Is there any way i can do this
 
This can be very tricky. Does that table have a primary key for each
record -- in other words, is there a key that is unique for each record,
even if the other fields match?

If yes, then you would need to build a query that returns the records that
contain a primary key that is not equal to the maximum or minimum primary
key for each grouping of the fields. Then use that query as the source of
the primary key values that identify the records to be deleted by a delete
query.

If you can post some details about the table, I'm sure we can talk you
through this.

By the way, if you don't have a primary key, then you will need to add one
(autonumber is fine) to the table before we try this.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top