Group:  Microsoft Access ยป microsoft.public.access.modulesdaovba.ado
Thread: DELETE with JOIN

DELETE with JOIN
JonWayn 12/16/2008 4:48:01 AM
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
Re: DELETE with JOIN
"Alex Dybenko" <alexdyb[ at ]PLEASE.cemi.NO.rssi.SPAM.ru> 12/16/2008 11:16:41 AM
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" <JonWayn[ at ]discussions.microsoft.com> wrote in message
news:E1BBCD0C-E9EA-4884-9727-E3F7AB111B22[ at ]microsoft.com...
[Quoted Text]
> 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

Re: DELETE with JOIN
JonWayn 12/16/2008 12:13:01 PM
I havent tried it yet but I assume it works and thanks a million

"Alex Dybenko" wrote:

[Quoted Text]
> 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" <JonWayn[ at ]discussions.microsoft.com> wrote in message
> news:E1BBCD0C-E9EA-4884-9727-E3F7AB111B22[ at ]microsoft.com...
> > 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
>
>

Home | Search | Terms | Imprint
Newsgroups Reader