View Full Version : Delete qry


editolis
10-27-2009, 02:53 AM
Hi all,
I have a table in a database with exactly the same data (double or triple data) but with different ID.
Example
ID - NAME – SURNAME
100 – JOHN – SMITH
252 – JOHN – SMITH
326 – JOHN - SMITH
Please need a help to delete the double data and keeping the data order by the newest ID.
So in my example I want to keep: 326 – JOHN – SMITH
I need a DELETE qry. Thank you in advance.

DCrake
10-27-2009, 03:01 AM
Create a new query that is grouped by name and Max Id view in datasheet to see if the results are what you hoped for. If Ok them change the query to a maketable query. This will create a temp table of all unique entries then flush the original table and append the temp table back into the original table.

David

editolis
10-27-2009, 03:29 AM
Thanks David.