Remove oldest duplicates

where do i post that sql code in?

I dont mind how the entries are selected and deleted. which ever is easiest.
i think your original idea of before an upload occurs of checking the database for entries already containing that filename getting deleted at that point will save having to search for duplicates on opening the database,

There are that many possibilities that i think that would be the easiest...
Woudl you agree?

Regards,

Alan
 
Question:
where do i post that sql code in?
Answer:
In your Access Db create a new query called 'DeleteOld' and paste this sql into it and save it

If you want to now do it from excel do the following - note correction to the quotation marks and missing asterix

Code:
'loop for deleting previous uploads
    
    sql = "DELETE [COLOR=red]*[/COLOR] FROM Batches WHERE Filename = [COLOR=red]'"[/COLOR] & fi & [COLOR=red]"'";"
[/COLOR]    cn.Execute (sql)
 
hi,

that did the trick thanks you. there was still an extra quotation mark but just tested it and it removed all of the entries of that filename before uploading it again which is perfect for what i need.

Thansk for bearing with me and helping me out on this ;-)
It is very much appreciated.

Regards,

Alan
 

Users who are viewing this thread

Back
Top Bottom