Delete Query Not Working

A

Allie

I have a couple of queries set up to get a very select list of records. So
far, all of those are working properly. Now that I have what data I need, I
would like to write a query to Delete those results with matching IDs from
the original table.
Table "Records" - holds data regarding absences
Query "Sums" - calculates difference between dates, sums absences
Query "PrevAnn" - all records from "Sums" who's difference is greater than 1
year, except the most recent date.

Those are the records I would like to delete from table "records"

This is what I have for the "Delete" query:

DELETE Records.*
FROM Records INNER JOIN PrevAnn ON Records.ID=PrevAnn.ID

Am I on the right track here?
 
D

Dale Fye

Annie,

Are you still trying to delete from the linked Excel spreadsheet, or did you
import into an Access table.

If you imported into an Access table, then you should be able to do:

DELETE Records.*
FROM Records
WHERE Records.ID IN (SELECT DISTINCT ID FROM PrevAnn)

--
HTH
Dale

Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top