Results 1 to 3 of 3
  1. #1
    JoBland is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5

    Combine data from one table to another based on unique ID and depth ranges


    I have 2 tables I would like to combine based on the unique ID and depth ranges. The image below is an example of what I need the query to do. The type3 and type4 values from table2 need to be populated into table1 using the depth ranges. If the depth range in table2 falls within the depth range in table1 then type3 and type4 columns in table1 are populated with the values from table2. In addition, I need the comments to concatenate. How can I do this with a query? Thanks for any guidance!
    Click image for larger version. 

Name:	form.PNG 
Views:	11 
Size:	27.7 KB 
ID:	35983

  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,902
    Try:

    UPDATE Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID SET Table1.Type3=Table2.Type3, Table1.Type4=Table2.Type4, Table1.Comments = Table1.Comments & "," & Table2.Comments WHERE Table2.depthFrom>=Table1.depthFrom AND Table2.depthTo<=Table1.depthTo;
    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
    JoBland is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    5
    This worked perfectly and saved me so much time! Thanks!

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

Similar Threads

  1. Replies: 4
    Last Post: 06-23-2017, 05:17 PM
  2. Replies: 2
    Last Post: 12-27-2013, 07:32 AM
  3. Replies: 3
    Last Post: 11-22-2013, 04:22 PM
  4. Query based on value ranges in other table
    By amrut in forum Queries
    Replies: 14
    Last Post: 04-06-2013, 07:44 PM
  5. Replies: 5
    Last Post: 07-06-2012, 03:22 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