Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    5

    Unanswered: syntax error (missing operator) in query expression in Access

    I'm having the same problem that "Breeze76" had (see http://www.dbforums.com/showthread.php?t=1048662). Can someone please help me.

    I'm trying to do a query in Access. the Sql statement works in SQL but it doesn't work in Access. It gives me the error message: error (missing operator) in query expression Attorney.EmpID = dbo_tbl_Files.AttyID
    INNER JOIN dbo_tbl_Employees As Secretary ON Secretary.EmpID = dbo_tbl_Files.SectID;


    Here is my SQL statement:
    SELECT dbo_tbl_Files.FileID, dbo_tbl_Files.SectID, dbo_tbl_Files.AttyID, (RTrim(Attorney.LName) & ', ' & RTrim(Attorney.FName)) as Attorney, (RTrim(Secretary.LName) & ', ' & RTrim(Secretary.FName)) As Secretary, dbo_tbl_Files.FileNo, dbo_tbl_Files.FileName, dbo_tbl_Files.Dept, dbo_tbl_Files.DateOpened, dbo_tbl_Files.Description, dbo_tbl_Files.Status
    FROM dbo_tbl_Files
    INNER JOIN dbo_tbl_Employees As Attorney ON Attorney.EmpID = dbo_tbl_Files.AttyID
    INNER JOIN dbo_tbl_Employees As Secretary ON Secretary.EmpID = dbo_tbl_Files.SectID;


    I am working with 2 tables:
    tbl_Files
    FileID
    AttyID
    SectID
    FileNo
    FileName
    Dept
    DateOpened
    Description
    Status

    tbl_Employees
    EmpID
    LName
    FName
    Role
    Last edited by gvee; 12-16-08 at 19:26. Reason: moved thread

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Question moved to Access where it will be more likely to get a targeted response
    George
    Home | Blog

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    ...Access just uses Trim(), not RTrim() or LTrim()
    George
    Home | Blog

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    although trim is a an alternative to rtrim(ltrim(mycolumn)) its not the same as rtrim

    Becuase of the way Access has its own way of doing joins (own syntax, requires bracketing) I'd suggest you draw up the query in the query designer.

    its probably going to be a missing bracketing expression, or possibly wrong join verb
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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