I have been searching the archives on this forum for a couple of days now, but I am unable to find a solution to my problem.
I have a table that has been imported from FoxPro which was part of a very poorly designed database. There are now 98000 records in this table, many of which are duplicate entries. Some of the records are exact duplicates, and some of them differ only in the contents of a memo field. I need a way to loop through the recordset and delete duplicate entries. If two entries are the same, except for the memo field, then I want to keep the one with the longer memo entry.
The main method that I have seen posted for removing dupes involves making a copy of the table's structure and setting the PKs so that no dupes are allowed when the data is pasted in. This will not work for me because every field in this table contains repeating values; only the comination of those values needs to be unique.
I have also tried to eliminate some of the dupes by using a SELECT DISTINCTROW query, but for some reason this returns the exact number of records that are in the original table.
Let me add that I am not talking about more than one or 2 duplicated records per "good" record, and that currently the only unique field is an autonumber field.
Is it possible to convert a find duplicates query to a delete query which will then remove any exact dupes? Is it possible to use a query to compare memo fields? Is there a better way of accomplishing this?
Thanks very much for any advice,
Ed
I have a table that has been imported from FoxPro which was part of a very poorly designed database. There are now 98000 records in this table, many of which are duplicate entries. Some of the records are exact duplicates, and some of them differ only in the contents of a memo field. I need a way to loop through the recordset and delete duplicate entries. If two entries are the same, except for the memo field, then I want to keep the one with the longer memo entry.
The main method that I have seen posted for removing dupes involves making a copy of the table's structure and setting the PKs so that no dupes are allowed when the data is pasted in. This will not work for me because every field in this table contains repeating values; only the comination of those values needs to be unique.
I have also tried to eliminate some of the dupes by using a SELECT DISTINCTROW query, but for some reason this returns the exact number of records that are in the original table.
Let me add that I am not talking about more than one or 2 duplicated records per "good" record, and that currently the only unique field is an autonumber field.
Is it possible to convert a find duplicates query to a delete query which will then remove any exact dupes? Is it possible to use a query to compare memo fields? Is there a better way of accomplishing this?
Thanks very much for any advice,
Ed