Results 1 to 5 of 5
  1. #1
    rtcary is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    35

    This Update query does not work in Access; appears to work in SQL Server

    This is the query I am using:



    Code:
    UPDATE t
    SET [RI Number] = j.[RI Number]
    FROM Members_20141022 t
    INNER JOIN [RI numbers] j ON (j.[Last Name] = t.[Last Name]) AND
    (j.[First Name] = t.[First Name])
    In the line SET [RI Number] = j.[RI Number] I get

    (missing operator).[RI Number]

    I want to Update the [RI number] in the Members_20141022 table using the
    [RI Number] in the [RI numbers] table WHERE the [First Name] and [Last Name] match.

    Suggestions welcomed...

    Todd

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The link doesn't appear to deal with joins, and if memory serves Access and SQL Server handle the join differently in an update query. In Access try this shot in the dark:

    UPDATE Members_20141022 t INNER JOIN [RI numbers] j ON (j.[Last Name] = t.[Last Name]) AND (j.[First Name] = t.[First Name])
    SET t.[RI Number] = j.[RI Number]
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Here's an example of UPDATE with an Inner Join (from FMS)

    Code:
    UPDATE tblAddress
            INNER JOIN tblZipCodes ON [tblAddress].[ZipCode] = [tblZipCodes].[ZipCode]
            SET [tblAddress].[City]  = [tblZipCodes].[City], 
        [tblAddress].[State] = [tblZipCodes].[State]
            WHERE ([Country] = 'US')

  5. #5
    rtcary is offline Advanced Beginner
    Windows XP Access 2002 (version 10.0)
    Join Date
    May 2010
    Posts
    35
    That did it! Thank you...

    Todd

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

Similar Threads

  1. Replies: 3
    Last Post: 02-16-2013, 08:28 AM
  2. Update where query, why does it not work?
    By joris in forum Queries
    Replies: 10
    Last Post: 05-18-2012, 01:26 AM
  3. Cant get Yes/No to work in Query Access 2010
    By colisemo in forum Queries
    Replies: 1
    Last Post: 09-20-2011, 02:21 PM
  4. Update Query does not allways work
    By newtoAccess in forum Queries
    Replies: 3
    Last Post: 02-07-2011, 01:13 PM
  5. Replies: 3
    Last Post: 12-20-2010, 09:22 AM

Tags for this Thread

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