Hi John,
Thanks for trying to help me out. Actually, I am already aware of the query
builder in MS Access. But I would like to build my queries dynamically and
I have quite a few tables involved, so it would be much easier if I could do
the Left and Right joins in my WHERE statement rather than in the FROM
statement.
Eron
----- Original Message -----
From: John Allred <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 22, 2000 8:08 PM
Subject: Re: Left Join syntax for MS Access
> Eron,
>
> You'd be surprised what some experimentation with the Access query
> builder will net you. But here are a couple of snippets that might shed
> some light on it for you.
>
> SELECT Person.persid, Person.FN, Person.LN, Pers_works.*
> FROM Person LEFT JOIN Pers_works ON Person.PersID = Pers_works.PersID
> WHERE person.persid = #ID#
>
> or, adding in a right join:
>
> FROM (Person LEFT JOIN Pers_works ON Person.PersID = Pers_works.PersID)
> RIGHT JOIN PersCounty ON Person.PersID = PersCounty.PersID
> WHERE ( ((PersCounty.CntyID)='#ID#'))
>
> The parentheses help you see what's getting joined to what.
>
> HTH,
> --John Allred
>
> Eron Cohen wrote:
> >
> > Hi Everyone,
> >
> > I am wondering if anyone knows the correct syntax for doing a LEFT JOIN
in
> > the WHERE statement of an MS Access Database query.
> >
> > I was told that it should be something like:
> >
> > contact_table.contact_ID =* sales_information.sales_contact_ID
> >
> > but this throws a syntax error:
> >
> > Syntax error (missing operator) in query expression '0=0 and
(show='ABC')
> > and (email_address_is_primary=1 and Contact_Phone_number_is_primary=1)
and
> > company_master_table.visible=1 AND contact_table.contact_ID =*
> > sales_information.sales_contact_ID
> >
> > Any ideas appreciated!
> >
> > Eron
> >
>
> --------------------------------------------------------------------------
----
> > Archives: http://www.eGroups.com/list/cf-talk
> > To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>
> --
> John Allred / Jackson, Mississippi
> Mississippi Counties
> http://www.mscounties.com/
> --------------------------------------------------------------------------
----
> Archives: http://www.eGroups.com/list/cf-talk
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.