Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Query problem

Status
Not open for further replies.

GreenFella

Programmer
Oct 23, 2001
41
CA
I am currently working with a delete query and two joined tables.

I wish to delete all records that fit criteria made up of one field from each table.

I only want to delete the records from one table. This is the SQL which I am using to do this...

DELETE Claim.*
FROM Claim INNER JOIN ActivityLog ON (Claim.StatusKey = ActivityLog.Status) AND (Claim.ClaimNumber = ActivityLog.ClaimNumber)
WHERE (((Claim.StatusKey)=11) AND (([Date]+45)<=Date()));

I want to delete all records from the Claim table where the claim is cancelled (Claim.StatusKey = 11) and has been cancelled for 45 days or more (ActivityLog.Date + 45 <= Date()).

When I try to run this query I get the following message:

Operation must use an updatable query.

I have tried to rework this query with no success.

Does anyone have any thoughts as to where I can go from here.

Thanks
GreenFella
 
If you can, create 2 test tables and break down the query into pieces.
 
DELETE *
FROM Claim
WHERE [StatusKey] = 11
AND [ClaimNumber] = (SELECT [ClaimNumber]
FROM ActivityLog
WHERE Date() >= [Date]+45)

M :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top