Results 1 to 2 of 2

Thread: SQL Syntax

  1. #1
    Join Date
    Oct 2003
    Posts
    1

    Red face Unanswered: SQL Syntax

    Could someone take a look at this SQL for me....


    Select tblProfileItems.*, tblPapersize.*, tblTitle.title,
    tblPapersize.IsCard, tblPapersize.hastemplate, Position,
    IsTravel, tblProduct.comments, tblstate.state, tblBusinessCardBacks.BCBackID
    from tblProfileItems
    left join tblProduct on tblProduct.ProductID=tblProfileItems.ProductID
    left join tblPapersize on tblProduct.PapersizeID=tblPapersize.PapersizeID
    left join tblTitle on tblProfileItems.TitleID=tblTitle.TitleID
    left join tblBusinessCardBacks on tblprofileItems.BCBackID=tblBusinessCardBacks.BCBa ckID
    left join tblprofile on tblProfileItems.profileID=tblProfile.profileID
    left join tblstate on tblprofileItems.stateID=tblState.stateID
    where ProfileItemID=1


    I keep getting a sytax error around the left joins. This is running on Microsoft Access XP. Does Access only allow one left join? When I added more left joins after the first one, then I started getting the syntax error.

  2. #2
    Join Date
    Jul 2003
    Location
    Amsterdam, Nederland
    Posts
    450

    You forgot the ( and )

    Select tblProfileItems.*, tblPapersize.*, tblTitle.title,
    tblPapersize.IsCard, tblPapersize.hastemplate, Position,
    IsTravel, tblProduct.comments, tblstate.state, tblBusinessCardBacks.BCBackID
    from (((((tblProfileItems
    left join tblProduct on tblProduct.ProductID=tblProfileItems.ProductID)
    left join tblPapersize on tblProduct.PapersizeID=tblPapersize.PapersizeID)
    left join tblTitle on tblProfileItems.TitleID=tblTitle.TitleID)
    left join tblBusinessCardBacks on tblprofileItems.BCBackID=tblBusinessCardBacks.BCBa ckID)
    left join tblprofile on tblProfileItems.profileID=tblProfile.profileID)
    left join tblstate on tblprofileItems.stateID=tblState.stateID
    where ProfileItemID=1

Posting Permissions

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