Consulting

Results 1 to 2 of 2

Thread: Select From Inner Join - advice needed

  1. #1
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location

    Select From Inner Join - advice needed

    Hi all,

    I had this working - and now it is broke.
    can anyone advise whether my SQL syntax is wrong or whether I need to look elsewhere?

    sSQL = "SELECT Organisations.OrgCode " & _
            "FROM Staff INNER JOIN Organisations " & _
            "ON Staff.Org = Organisations.Id " & _
            "WHERE Staff.cName = '" & myPerson & "'"
    My Organisations table has fields:
    • ID (PK)
    • OrgName
    • OrgCode

    My Staff Table has fields that include:
    • ID (PK)
    • cName (calculated Field)
    • Org (linked to Organisations.ID)


    myPerson is a string variable that should = cName for one record

    Thanks
    Werafa
    Remember: it is the second mouse that gets the cheese.....

  2. #2
    VBAX Mentor
    Joined
    Aug 2012
    Posts
    367
    Location
    found it - was data type mismatch on the join
    Remember: it is the second mouse that gets the cheese.....

Posting Permissions

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