Delete Query

G

Gina Liddle

I've created an Unmatched query to gives all records in table RTR_Activity
that aren't in table Activity1. When I try to manually delete the resultant
records they reappear when the query is rerun. If I try to run a delete
query based on the Unmatched query I get "Could not delete from specified
tables" even though I have full rights to do so. What have I done wrong?

If this helps the SQL reads:

DELETE RTR_Activity.*, Activity1.TaskID
FROM RTR_Activity LEFT JOIN Activity1 ON RTR_Activity.TaskID =
Activity1.TaskID
WHERE (((Activity1.TaskID) Is Null));



Ta
 
M

Michael Lipscombe

hi

try

DELETE RTR_Activity.*
FROM RTR_Activity LEFT JOIN Activity1
ON RTR_Activity.TaskID =Activity1.TaskID
WHERE (((Activity1.TaskID) Is Null));

if not

try

DELETE RTR_Activity.*
WHERE RTR_Activity.TaskID NOT IN (SELECT DISTINCT
Activity1.TaskID FROM Activity1) ;
 

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