DELETE with JOIN

J

JonWayn

I am still using JET SQL and I am pretty comfortable with writing SQL
statements but I cant figure out the syntax for writing a delete sql which
includes a join. Is it even allowed?

DoCmd.RunSQL "DELETE T1.* FROM [DelTable] AS T1 INNER JOIN [JoinTable] " _
& "AS T2 ON T2.[Citation2] = T1.[Citation1] WHERE T1.FirstName = 'Joe'"

looks like a beautiful statement to me but it throws an error and just
doesnt work. Can anyone here shed some light on this matter?

Thanks
 
J

JonWayn

I havent tried it yet but I assume it works and thanks a million

Alex Dybenko said:
Hi,
have a look here:
http://accessblog.net/2004/10/access-delete-update-sql-in-jet.html

--
Best regards,
___________
Alex Dybenko (MVP)
http://accessblog.net
http://www.PointLtd.com


JonWayn said:
I am still using JET SQL and I am pretty comfortable with writing SQL
statements but I cant figure out the syntax for writing a delete sql which
includes a join. Is it even allowed?

DoCmd.RunSQL "DELETE T1.* FROM [DelTable] AS T1 INNER JOIN [JoinTable] " _
& "AS T2 ON T2.[Citation2] = T1.[Citation1] WHERE T1.FirstName = 'Joe'"

looks like a beautiful statement to me but it throws an error and just
doesnt work. Can anyone here shed some light on this matter?

Thanks
 

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