DELETE Queries with Joins (1 Viewer)

winshent

Registered User.
Local time
Today, 16:26
Joined
Mar 3, 2008
Messages
162
I'm really confused with this..

I have two queries, both delete from the same table and both have joins...

This one works:
Code:
DELETE  RequestCheck.*
FROM(
SELECT TOP 3 PayRequest.RequestID, PayRequest.GBPAmount, PayRequest.Currency, PayRequest.RequestDate
FROM PayRequest
WHERE (((PayRequest.Currency)="EUR Euro") AND ((PayRequest.RequestDate)>#11/16/2014#))
ORDER BY PayRequest.GBPAmount
) AS TOP3 INNER JOIN RequestCheck ON TOP3.RequestID = RequestCheck.RequestID
WHERE (((RequestCheck.CheckID)=8));

This one does not:
Code:
DELETE RequestCheck.*
FROM 300_tblDeleteRequestCheck INNER JOIN RequestCheck ON [300_tblDeleteRequestCheck].RCID = RequestCheck.RCID;

Can anyone make sense of this ?
 

jdraw

Super Moderator
Staff member
Local time
Today, 12:26
Joined
Jan 23, 2006
Messages
15,364
This syntax works fine for me (seems similar to yours)
Code:
 DELETE Animal.*
FROM Animal INNER JOIN AnimalDeletes
  ON 
 [AnimalDeletes].DelID = Animal.AnimalID;

Attached jpg shows Animal table after the query; and AnimalDeletes shows records to be deleted.
 

Attachments

  • AnimalRelatedTables.jpg
    AnimalRelatedTables.jpg
    15.5 KB · Views: 77

Users who are viewing this thread

Top Bottom