Results 1 to 6 of 6
  1. #1
    aball65 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    4

    Update Select: Operation Must Use an Updateable Query

    Can someone please help with the following query/error:



    update EXCEL_IEMATRIX_NULLS set EXCEL_IEMATRIX_NULLS.pyld_id = (select PYLD.pyld_id from PYLD inner join EXCEL_IEMATRIX_NULLS on PYLD.pyld=EXCEL_IEMATRIX_NULLS.pyld);

    Operation must use an updateable query.

    Thanks

  2. #2
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Exactly what are you trying to do. Your SQL is attempting to update a field with a recordset. Won't work.

  3. #3
    aball65 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    4
    I'm migrating MS Excel spreadsheet data to MS Access. I've imported the Excel data into a temporary Access table called EXCEL_IEMATRIX_NULLS and am now trying to update this table with the foreign keys. For example, the EXCEL_IEMATRIX_NULLS table contains a field called "pyld" with various values (e.g., Encounter). My Access database has a "PYLD" table which stores all possible pyld values (e.g., Encounter, Allergy, etc.) along with each values primary key. I'm trying to update the various EXCEL_IEMATRIX_NULLS table fields with their associated primary keys. Once I do this, I'm going to create an Access table based on a "select into" command. Does that make sense?

  4. #4
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Try this: add a new field to your temp table call it newpyld_id and run the following query. Once it runs and you've validated the results delete the old pyld_id column and rename the newpyld_id column to pyld_id.

    Update EXCEL_IEMATRIX_NULLS set EXCEL_IEMATRIX_NULLS.newpyld_id = (Select PYLD.pyld_ID from PYLD Inner join PYLD.Description = EXCEL_IEMATRIX_NULLS.pyld_id):

  5. #5
    aball65 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    4
    I had to make some syntax changes and replaced your description column with my pyld column:

    Update EXCEL_IEMATRIX_NULLS set EXCEL_IEMATRIX_NULLS.newpyld_id = (Select PYLD.pyld_ID from PYLD Inner join EXCEL_IEMATRIX_NULLS on PYLD.pyld = EXCEL_IEMATRIX_NULLS.pyld);

    The above statement raises the same error.

  6. #6
    aball65 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2012
    Posts
    4
    The following worked for me:

    update (select * from EXCEL_IEMATRIX_NULLS inner join PYLD on EXCEL_IEMATRIX_NULLS.pyld = PYLD.pyld) set EXCEL_IEMATRIX_NULLS.pyld_id = PYLD.pyld_id;

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

Similar Threads

  1. Operation must use an updateable query.
    By pericherlasuma in forum Access
    Replies: 1
    Last Post: 05-16-2011, 09:45 AM
  2. Replies: 29
    Last Post: 04-18-2011, 07:09 AM
  3. Operation must use an updateable query
    By skaswani in forum Queries
    Replies: 0
    Last Post: 12-23-2010, 11:59 PM
  4. Operation Must use an Updateable Query
    By Lady_Jane in forum Queries
    Replies: 2
    Last Post: 12-14-2010, 03:02 PM
  5. Update query using iif and select
    By josh2009 in forum Queries
    Replies: 1
    Last Post: 04-23-2010, 11:33 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