Delete Stantements in VBA

Humanski

Registered User.
Local time
Today, 17:43
Joined
Aug 26, 2002
Messages
13
I want to do the following from a table with 16000 records I would like to delete the duplicate record and keep the origional.

E.g


INV_NO REF_NO WT DATE
123 1234 20 19/12/80
123 1234 20 20/12/80

I have a table with the duplicates above but the dates are different, I woulkd like to delete the 2nd record with the later date. I need to do this to 16000, and turn the table into 8000 as half of them will still be needed.

Can anybody Help?

PAwel
 
Humanski said:
I want to do the following from a table with 16000 records I would like to delete the duplicate record and keep the origional.

E.g


INV_NO REF_NO WT DATE
123 1234 20 19/12/80
123 1234 20 20/12/80

I have a table with the duplicates above but the dates are different, I woulkd like to delete the 2nd record with the later date. I need to do this to 16000, and turn the table into 8000 as half of them will still be needed.

Can anybody Help?

PAwel

I think you need to create a query using Max on the Date field and then use that query as a sub query in a DELETE query ensuring you only delete the records required.

Then run the query in your code.

HTH
Paul
 
Why do you keep posting the same question? You have answers in other threads. I know you're new here but you really need to keep track of your posts. None of the people trying to help you is being paid for their efforts. If you don't understand an answer or have additional questions, post a reply to the same thread so that people can follow the discussion.
 

Users who are viewing this thread

Back
Top Bottom