Results 1 to 5 of 5
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409

    Update query - two table-a field different

    Hi,
    as you can see in the db i have two tables

    1) iscrittiOCf


    2) iscrittiOcfNuovi

    look at the select query, i want to update the records in "iscrittiOcf" table from "iscrittiOcfNuovi" table, with the criteria you can see in the query.
    thanksUpdate.zipUpdate.zip

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    click the UPDATE button, then fill in the UPDATE TO like:

    iscrittiOcf.CAP
    updateto:iscrittiOcfNuovi.CAP

    do it for every field

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    Thank you very much, i normally make those operations but i use the ID, in this case is not possibile.
    I made the query as an update query, but it adds the record instead of updating it. i can't get it
    Attached Files Attached Files

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,979
    You have created an UPSERT or UPEND query due to the use of left joins.
    This will both UPDATE existing records and APPEND new records. See UpEnd Query (isladogs.co.uk)
    To prevent records being appended, use INNER JOINs instead
    Last edited by isladogs; 03-31-2022 at 02:04 AM.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    thanks
    i made this query, seems to work fine
    Attached Files Attached Files

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

Similar Threads

  1. Query to update one field in a table
    By Ooogaboga in forum Queries
    Replies: 1
    Last Post: 09-27-2016, 03:08 AM
  2. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  3. Replies: 3
    Last Post: 02-13-2013, 10:15 AM
  4. Replies: 12
    Last Post: 03-17-2012, 04:46 AM
  5. Replies: 1
    Last Post: 08-31-2011, 04:03 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