Results 1 to 7 of 7
  1. #1
    gm_lowery is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    13

    Assistance with SQL syntax.

    Hi everyone,



    Im trying to do a left join query in Access using SQL but I am stumped at the syntax and am thus getting a join expression not supported error since I rarely ever use it. Can someone please help format the proper syntax for me?

    SELECT Series.SeriesID, Series.SeriesActive, Series.SeriesTitle, Series.SeriesType, Sessions.SeriesID, Sessions.SessionStart, Sessions.SessionEnd, Sessions.LeaderID, Sessions.LocationID, Sessions.MaxParticipants, Sessions.SessionNote INTO [Archive Table]
    FROM Participants, Series
    LEFT JOIN Sessions ON Series.SeriesID = Sessions.SeriesID

    Many thanks,

    Michael

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Are you trying to do an Append Query or a Select Query?
    If you are doing a Select Query, remove the "INTO [ARCHIVE TABLE]" part.
    If you are trying to do an Append Query, your syntax doesn't look quite right (see: http://office.microsoft.com/en-us/ac...001032245.aspx).

    Also, what is the "Participants" in your From clause? It it is a third table, you probably need to join that too.

  3. #3
    gm_lowery is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    13
    I am actually trying to do a make table query. I dont know if that changes anything.

  4. #4
    gm_lowery is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    13
    And yes participants is also a third table.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    How about

    SELECT Series.SeriesID, Series.SeriesActive, Series.SeriesTitle, Series.SeriesType, Sessions.SeriesID, Sessions.SessionStart, Sessions.SessionEnd, Sessions.LeaderID, Sessions.LocationID, Sessions.MaxParticipants, Sessions.SessionNote INTO [Archive Table]
    FROM Series LEFT JOIN Sessions ON Series.SeriesID = Sessions.SeriesID

    Edit: you weren't using the third table, and without a join it would have resulted in a Cartesian product.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    gm_lowery is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2012
    Posts
    13
    No I need the data from the third table as well. Whether it is a right or left join I am not sure, but it is one of the two.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Put the query in design view, drop in the third table and draw the joins manually, clicking on them to edit. The descriptions there should guide you to the proper join. Then switch to SQL view and see what it produced.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query and report assistance
    By POS120 in forum Queries
    Replies: 1
    Last Post: 03-18-2012, 04:48 PM
  2. dlookup assistance
    By underscore in forum Access
    Replies: 4
    Last Post: 12-28-2011, 06:32 AM
  3. New to Access - Looking for some basic assistance
    By Dave_EntryIT in forum Access
    Replies: 2
    Last Post: 03-27-2011, 11:25 PM
  4. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM
  5. Need Assistance with Forms
    By JDA2005 in forum Forms
    Replies: 5
    Last Post: 06-30-2009, 03:37 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