Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2006
    Posts
    2

    Unanswered: Inner Join Syntax

    I cannot get my head round the join syntax for Access and so i'd be very grateful if someone could shed some light on it. I have looked around at a few posts and it seems as tho using brackets is the key, but i cannot get the below query to function correctly.

    Code:
    select * from refno 
    ((inner join sites on refno.siteid=sites.sitedid)
    inner join suppliers on refno.supplierid=suppliers.id)
    inner join builditems on refno.itemid=builditems.itemid
    running the above only returns this query

    Code:
    select * from refno
    inner join builditems on refno.itemid=builditems.itemid
    any help would be much appreciated.

    many thanks
    gmxp

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    select please
         , list
         , your
         , columns
         , individually 
      from ((
           refno 
    inner 
      join sites 
        on sites.sitedid = refno.siteid
           )
    inner 
      join suppliers 
        on suppliers.id = refno.supplierid
           )
    inner 
      join builditems 
        on builditems.itemid = refno.itemid
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2006
    Posts
    2
    Hi r937,

    Thank you for your help. I have tried altering the code as you suggest and i now get the following error

    Code:
    cannot add the table '((refno'.
    Perhaps should have mentioned this in my earlier post, but im using access 2000 (dont know if that makes a difference).

    Code:
    select refno.ref,
    sites.name, 
    suppliers.name, 
    builditems.ItemName
      from 
    ((refno 
    inner 
      join sites 
        on sites.sitedid = refno.siteid
           )
    inner 
      join suppliers 
        on suppliers.id = refno.supplierid
           )
    inner 
      join builditems 
        on builditems.itemid = refno.itemid
    Thanks again for your assistance.
    gmxp

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    "cannot add the table"????

    i've never seen that error message before
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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