Results 1 to 5 of 5
  1. #1
    boilermaker1997 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2015
    Posts
    1

    SQL Statement Error - Joins

    I'm trying to join several tables in an access query. One of the fields I'm joining on is formatted as a number in one table and text in another, so I'm using the Val function to make the data types match. That part of the statement work (first 4 lines shown below). I'm trying to add 2 additional joins, but I'm getting a syntax error when I try to run the query. I'm pretty inexperienced at Access so I'm not able to determine what is wrong with the syntax. Any advice is appreciated.



    SQL Code

    SELECT *
    FROM
    (Table1 INNER JOIN Table2
    ON Table1.PPL_DEPT = Val(Table2.DEPT))
    Table1 LEFT JOIN Table3 ON Table1.FUNCTION = Table3.Function) LEFT JOIN Table4 ON Table1.PPL_EMAIL = Table4.[e-Mail];

  2. #2
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,815
    You have unmatched parentheses on the last line- )

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    I don't see any Val functions here.
    Only tables, no queries.

    you can also try. CLNG

  4. #4
    Micron is online now Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,815
    BTW - all should know that this is cross-posted in Mr.Excel forum without being declared here.

  5. #5
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,046
    Hi,

    just a remark: try to avoid SQL joins on calculated fields: the query plan can't use indexes and will be based on full table scans, so the performance will be very slow.

    kind regards
    NG

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to prevent ambiguous outer joins error message
    By craigugoretz in forum Queries
    Replies: 1
    Last Post: 02-19-2015, 08:10 AM
  2. multiple inner joins getting syntax error
    By ringram in forum Modules
    Replies: 5
    Last Post: 10-23-2014, 02:58 PM
  3. Replies: 1
    Last Post: 09-22-2014, 08:54 AM
  4. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  5. Multiple outer joins - error message
    By Lipi in forum Queries
    Replies: 1
    Last Post: 09-16-2010, 02:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums