Results 1 to 7 of 7
  1. #1
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138

    Query to append table

    I Have a table (tapes) with a lot of data in in, it have about 10 columns.
    I am making a new table (Recieved) with data that has changed in it (dateback) so I am using only 3 columns.



    I am trying to append/change this 3 columns into the tapes table, it is running, but it makes new data rows, and not change the ones that is in it..

    And in one colum I have name (booknumber) this booknumber can be in more than 1 row( about 15 at most), so how can I if I run the query, that it keeps the columns that has no change in them the same and only change the 3columns that I want to and how do I let it change all the same bookumber) .

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Have to JOIN the tables on key fields. How are tables related? Is booknumber in both tables?

    Why do you need these 3 columns in tapes?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    Quote Originally Posted by June7 View Post
    Have to JOIN the tables on key fields. How are tables related? Is booknumber in both tables?

    Why do you need these 3 columns in tapes?

    If you want to provide db for analysis, follow instructions at bottom of my post.
    Here is the table in zip format

    1. Tapes (Table) is my main table where all the info must go to. This table have 13 columns in it, and I want to update some data in it.
    2. Recieved (Table) is one that I want to import(it is working) every day(data change evry day). Only 3 columns in this table (StickerNumber, DateReturn and RecievedBack).
    3. In tapes(Table) I only need to add(change info) to the (DateReturn and RecievedBack) columns as they are empty. I have added StickerNumber to let access know only those must be updated.
    4. YOu can see that there is more than on row with the same StickerNumber.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Yes, rows with same sticker number will receive the same data.

    UPDATE Recieved INNER JOIN Tapes ON Recieved.StickerNumber = Tapes.StickerNumber SET Tapes.DateReturn = [Recieved].[DateReturn], Tapes.RecievedBack = [Recieved].[RecievedBack];


    NOTE: You have used an incorrect spelling of Received
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    UPDATE Recieved INNER JOIN Tapes ON Recieved.StickerNumber = Tapes.StickerNumber SET Tapes.DateReturn = [Recieved].[DateReturn], Tapes.RecievedBack = [Recieved].[RecievedBack];


    June7, I have try to put this top info into the
    Update to: in the query, but it gives me invalid syntex, so I am not sure if it is in the correct place for it.



  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    Copy/paste my query statement into SQLView of a new query. Then switch to Design view.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    hendrikbez is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2014
    Posts
    138
    June7

    Thank you I have got i to work.

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

Similar Threads

  1. Replies: 12
    Last Post: 12-18-2017, 05:33 PM
  2. Replies: 19
    Last Post: 10-03-2017, 09:10 AM
  3. Replies: 3
    Last Post: 06-01-2017, 06:57 AM
  4. Query needs append a table
    By ande8698! in forum Queries
    Replies: 1
    Last Post: 10-28-2014, 08:51 AM
  5. Replies: 1
    Last Post: 10-06-2011, 08:37 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