Solved Delete Query from Table A If found in Table B

Number11

Member
Local time
Today, 01:14
Joined
Jan 29, 2020
Messages
619
Hi,

I need to create a query that will delete all records within TableA where they are present in TableB

The Matching Fields I have

OrderNo
OrderDate

DELETE FROM TableA
INNER JOIN TableB
ON TableA.OrderNo = TableB.OrderNo
AND TableA.OrderDate= TableB.OrderDate

however doesn't work :(

1634132292637.png
 
try
Code:
DELETE
FROM TableA
WHERE Exists(SELECT * FROM TableB WHERE  TableA.OrderNo = TableB.OrderNo
AND TableA.OrderDate= TableB.OrderDate)
 
try
Code:
DELETE
FROM TableA
WHERE Exists(SELECT * FROM TableB WHERE  TableA.OrderNo = TableB.OrderNo
AND TableA.OrderDate= TableB.OrderDate)
no didnt work now i get

1634133050178.png
 
Is Table B an archive table? How many records are in it? How many records in Table A?
 

Users who are viewing this thread

Back
Top Bottom