Skip to main content
February 21, 2008
Answered

Access Query

  • February 21, 2008
  • 1 reply
  • 230 views
Hi, I am trying to write a delete query in Access, but not sure where to start.

I have two tables, request and week1, that share a field, "id".

I want to keep all of the records in request, but delete any records in week1 that do not have an id that is also present in request.

Please help! Thanks.
This topic has been closed for replies.
Correct answer paross1
One way would be something like this:

DELETE FROM week1 w
WHERE NOT EXISTS (SELECT 1
FROM request r
WHERE r.id = w.id)

Phil

1 reply

paross1Correct answer
Participating Frequently
February 21, 2008
One way would be something like this:

DELETE FROM week1 w
WHERE NOT EXISTS (SELECT 1
FROM request r
WHERE r.id = w.id)

Phil