Delete Query with inner join (1 Viewer)

Gismo

Registered User.
Local time
Today, 19:19
Joined
Jun 12, 2017
Messages
1,298
Hi,

I am trying to delete records from my history table (TBL A) if value in my list table (TBL B) has been met but I get a "Could not delete from specified tables" error.. below is my code.

Code:
DELETE [Aircraft List].Active, [SB-AD History].*
FROM [SB-AD History] INNER JOIN [Aircraft List] 
ON [SB-AD History].[Aircraft Registration] = [Aircraft List].[Aircraft Registration]
WHERE ((([Aircraft List].Active)=False));
 

isladogs

MVP / VIP
Local time
Today, 17:19
Joined
Jan 14, 2017
Messages
18,211
You may have a read only query
Try this so it only deletes unique records:

Code:
DELETE DISTINCTROW [Aircraft List].Active, [SB-AD History].*
FROM [SB-AD History] INNER JOIN [Aircraft List] 
ON [SB-AD History].[Aircraft Registration] = [Aircraft List].[Aircraft Registration]
WHERE ((([Aircraft List].Active)=False));
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 00:19
Joined
May 7, 2009
Messages
19,230
DELETE [SB-AD History].*
FROM [SB-AD History] WHERE [Aircraft Registration] In (Select T1.[Aircraft Registration] From [Aircraft List] as T1 Where T1.Active=False)
 

Users who are viewing this thread

Top Bottom