What am I doing wrong?

E

Ed

I want to delete records in table C that are not in table Q.

DELETE Q.CableNo, C.*
FROM qryCableCreate AS Q RIGHT JOIN tblCables AS C ON Q.CableNo = C.CableNo
WHERE (((Q.CableNo) Is Null));
 
B

Brendan Reynolds

DELETE * FROM tblCables WHERE CableNo NOT IN (SELECT CableNo FROM
qryCableCreate)
 
J

John Vinson

I want to delete records in table C that are not in table Q.

DELETE Q.CableNo, C.*
FROM qryCableCreate AS Q RIGHT JOIN tblCables AS C ON Q.CableNo = C.CableNo
WHERE (((Q.CableNo) Is Null));

Including Q in the delete clause. In the query grid, uncheck its Show
box and make sure it says WHERE rather than FROM; equivalently

DELETE C.*
FROM qryCableCreate AS Q RIGHT JOIN tblCables AS C ON Q.CableNo =
C.CableNo
WHERE (((Q.CableNo) Is Null));


John W. Vinson[MVP]
 

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

Top