Delete Query

  • Thread starter Thread starter Gina Liddle
  • Start date Start date
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
 
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) ;
 
Back
Top