Results 1 to 2 of 2
  1. #1
    polisasimo is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    9

    SQL Syntax Error

    Hello Everyone,



    I am trying to update records from another table. I am using this thread as an example:

    http://stackoverflow.com/questions/2...=votes#tab-top

    With this SQL:

    UPDATE
    Sales_Import
    SET
    Sales_Import.AccountNumber = RAN.AccountNumber
    FROM
    Sales_Import SI
    INNER JOIN
    RetrieveAccountNumber RAN
    ON
    SI.LeadID = RAN.LeadID


    After transcribing the SQL to meet my schema:

    UPDATE
    Master_chapter
    SET
    Master_chapter.Revision = Pending_Revisions.Revision
    FROM
    Master_chapter MC
    INNER JOIN Pending_Revisions PR
    ON
    MC.ID = PR.Master_Chapter_Index

    I keep getting the following error on my VB code line: CurrentDb.Execute SQL, dbFailOnError

    Syntax error (missing operator) in query expression
    'UPDATE Master_chapter SET Master_chapter.Revision = Pending_Revisions.Revision FROM Master_chapter MC INNER JOIN
    Pending_Revisions PR ON MC.ID = PR.Master_Chapter_Index'.

    Any ideas on where the syntax for the SQL is wrong would be greatly appreciated. It seems the "ON MC.ID = PR.Master_Chapter_Index" should be right?

    Thanks

  2. #2
    polisasimo is offline Novice
    Windows 8 Access 2013
    Join Date
    Jun 2014
    Posts
    9
    Tried this seems to work better:

    UPDATE Master_chapter INNER JOIN Pending_Revisions ON Master_chapter.ID = Pending_Revisions.Master_Chapter_Index SET Master_chapter.Revision = Pending_Revisions.Revision

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

Similar Threads

  1. Replies: 11
    Last Post: 05-01-2014, 11:56 AM
  2. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  3. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 AM

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