View Full Version : Removing semi-duplicate records


Gyto
07-07-2009, 03:04 AM
Hi there,

I have the following data in a table:


ID Property ServiceDate

1 A 01/01/09
2 A 01/01/09
3 A 02/02/09
4 B 03/03/09
5 B 06/06/09
6 B 03/03/09


I need a query to remove the duplicate rows where the Property and ServiceDate fields are duplicated. I.E. Property A has the service date 01/01/09 twice and it is only necessary to have one entry for this date. So, the final table should look like this:


ID Property ServiceDate

1 A 01/01/09
3 A 02/02/09
4 B 03/03/09
5 B 06/06/09


Any ideas?

Thanks

Matt

MStef
07-07-2009, 03:34 AM
I can suggest, make a new table (tbleNew), with the same fields. Put index1 on the fields "Property" and "ServiceDate" (One index only), put Index Properties UNIQUE = YES. Make an APPEND QUERY on tihs tbleNew, run tis query. After that you can delete or rename your original table, and rename a tbleNew on original name. Before, take a copy of your mdb.

Gyto
07-07-2009, 06:03 AM
Thanks, that sounds feasable...will give it a go! Cheers