Results 1 to 4 of 4
  1. #1
    ricksil is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    10

    Complex Update syntax

    How would I do an "update from" in MS Access SQL Syntax? I tried this and no luck:
    Code:
    update table1 t1
    set    col1 = t2.col1,
           col2 = t2.col2,
           col3 = t3.col3
    from   table2 t2,
           table3 t3,
           table4 t4
    where  t1.col4 = t2.col4
    and    t1.col5 = t2.col5
    and    t1.col6 = t2.col6
    and    t1.col7 = t4.col7
    and    t1.col8 = 'X'
    and    t2.col9 = 'ABC';


  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Maybe you can cerate a SELECT query using table2, table3, and table4 and save it and name it. Then, create another query using Table1. Turn the second query into an Update query and drag the query you created earlier onto the design surface of your second query.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Try this
    Code:
    UPDATE Table1 AS T1, 
           Table2 AS T2, 
           Table3 AS T3, 
           Table4 AS T4 
    
    SET T1.col1 = T2.col1, 
        T1.col2 = T2.col2, 
        T1.col3 = T3.col3 
    
    WHERE (((T1.col4)=[T2].[col4])
       AND ((T1.col5)=[T2].[col5])
       AND ((T1.col6)=[T2].[col6])
       AND ((T1.col7)=[T4].[col7])
       AND ((T1.col8)='X')
       AND ((T2.col9)='ABC'));

  4. #4
    ricksil is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    10
    That did the trick. Thank you!!!

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

Similar Threads

  1. Complex Update Query
    By gemadan96 in forum Queries
    Replies: 5
    Last Post: 11-27-2012, 12:59 PM
  2. Update syntax
    By looloo in forum Programming
    Replies: 6
    Last Post: 09-23-2011, 07:58 PM
  3. sql UPDATE syntax help
    By ducthang88 in forum Programming
    Replies: 1
    Last Post: 12-04-2010, 12:12 PM
  4. Syntax For After Update Event
    By MuskokaMad in forum Forms
    Replies: 14
    Last Post: 03-12-2010, 01:48 PM
  5. Complex Update query
    By niihla10 in forum Queries
    Replies: 1
    Last Post: 08-28-2009, 01:02 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