jaredmcguire
Programmer
I have a database with 2 tables EmailList and Optout. The EmailList table contains 3 fields: FirstName, LastName, and EmailAddress. The Optout table has one field: EmailAddress.
I have figured out how to perform a SELECT query that will display records from the EmailList table if there email is also in the Optout table.
My question is how do I turn into a DELETE query? Below is what I have so far and it gives me an error that simply says it can't delete the data. I'm testing this in access and when I run this as a view it returns the data to delete with no problem. What am I doing wrong?
DELETE EmailList.*
FROM EmailList INNER JOIN optout ON EmailList.EmailAddress = optout.EmailAddress
WHERE EmailList.EmailAddress=optout.EmailAddress
I have figured out how to perform a SELECT query that will display records from the EmailList table if there email is also in the Optout table.
My question is how do I turn into a DELETE query? Below is what I have so far and it gives me an error that simply says it can't delete the data. I'm testing this in access and when I run this as a view it returns the data to delete with no problem. What am I doing wrong?
DELETE EmailList.*
FROM EmailList INNER JOIN optout ON EmailList.EmailAddress = optout.EmailAddress
WHERE EmailList.EmailAddress=optout.EmailAddress