delete duplicates "specify the table containing the records you want to delete"

G

gamarule

Hi im trying to create a query that will delete the duplicated contacts from
to different tables but everytime i try to run the query i get "specify the
table containing the records you want to delete" error.
this is the SQL View of the query:
DELETE DISTINCTROW imports.*, imports.FirstName, imports.LastName, imports.
BusinessPhone
FROM Contacts INNER JOIN imports ON Contacts.BusinessPhone=imports.
BusinessPhone
WHERE (((imports.FirstName)=Contacts.FirstName) And ((imports.LastName)
=Contacts.LastName) And ((imports.BusinessPhone)=Contacts.BusinessPhone));

imports and Contacts are my two tables.
im using access 2007

Please help.
Thanks
 
A

Allen Browne

In query design view, uncheck the Show box under all fields except the star.

Despite the way the Access query designer handles this, the SQL statement
should not have a field list, i.e. it should be:
DELETE FROM ...

If you are still stuck, you might be able to leave the Contacts table out of
the query, and use a subquery instead. Like this:
http://allenbrowne.com/subquery-01.html#DeDuplicate
 
Top