qryDeleteDuplicates

G

Guest

I am importing data from one table to another. There is a potential for
duplicates that I am trying to eliminate using a delete query. The
tblAppointments has the following fields an appointmentID (autonumber and
keyfield), clientID(not unique), and AppointmentDate.

tblUpdateAppointments is used to update tblAppointments using an append
query. But before I want the append query to run, I would like to remove
records that have the same clientID AND AppointmentDATE because these are
duplicates. I have written the following delete query but it will not run and
I'm not sure why. Any help would be much appreciated.

DELETE tblUpdateAppointments.*, tblUpdateAppointments.[clientID],
tblUpdateAppointments.[AppointmentDate]
FROM tblUpdateAppointments, tblAppointments
WHERE (((tblUpdateAppointments.[clientID])=[tblAppointments].[clientID]) AND
((tblUpdateAppointments.[AppointmentDate])=[tblAppointments].[AppointmentDate]));
 
G

Guest

hi,

you can delete from one table in a SQL statement.
DELETE tblUpdateAppointments.* WHERE ...
should work.

do not include individual field names with delete. It deletes a complete
record and never a few fields within a record.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top