SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot davejuk's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MS Access: JOIN ON two conditions

    Is it possible to have more than one condition for a JOIN in MS Access?

    If I do this, I get 'Join expression not supported.', caused by having the second JOIN condition:

    SELECT Table1.SomeField, Table2.OtherField FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.Tbl1_ID AND Table2.JoinThisRecord = TRUE

    Am I just using the wrong syntax? Or is it not possible to achieve this with Access? If so, it seems a bizarre limitation.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,341
    Mentioned
    63 Post(s)
    Tagged
    3 Thread(s)
    that should work

    maybe with parentheses?

    SELECT Table1.SomeField, Table2.OtherField FROM Table1 INNER JOIN Table2 ON ( Table1.ID = Table2.Tbl1_ID AND Table2.JoinThisRecord = TRUE )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Zealot davejuk's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Arghhh that's it, thanks for your light speed reply.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •