Results 1 to 4 of 4
  1. #1
    kyohnke is offline Novice
    Windows 10 Access 2013 64bit
    Join Date
    Dec 2017
    Posts
    1

    Creating new fields by merging

    Hello!


    I'm currently working with a healthcare table (Table 1) and trying to merge it based on a unique ID number. This primary table contains individual lab results and symptoms. I need to attach diagnosis codes to this table based on the unique ID number. Unfortunately, all the codes were listed individual and not as individual fields within one record with the unique ID number (Table 2). Is there a way to merge these two tables so I end up with all diagnosis codes in one record with the lab results and symptoms (Table 3)? I don't necessarily need the description associated with each code, but that would also be helpful if they could connected some how without making the table extremely long. Some of the records can have up to 20 Dx codes. Examples below:


    Table 1:
    Unique ID Date/Time Lab Results Symptoms
    111100002 12/12/2017 130 Positive 36.5
    111200000 11/15/2016 2350 Negative 38.5
    111222333 5/6/2016 1415 Positive 36.5


    Table 2:
    Unique ID Dx Code Description
    111100002 I12.9 Hypertension
    111100002 E11.33 Bronchospasm
    111100002 J98.5 UTI
    111200000 A41.4 Type 2 Diabetes
    111222333 E94.2 Anemia
    111222333 N13.3 Kidney Failure


    Table 3:
    Unique ID Date/Time Lab Results Symptoms Dx Code1 Dx Code2 Dx Code3
    111100002 12/12/2017 130 Positive 36.5 I12.9 E11.33 J98.5
    111200000 11/15/2016 2350 Negative 38.5 A41.4
    111222333 5/6/2016 1415 Positive 36.5 E94.2 N13.3

  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,929
    Won't be simple.

    For one approach, review http://allenbrowne.com/func-concat.html
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    access doesnt really want to store data like table3. (1 and 2 are good)
    you may be able to create a CROSSTAB query to produce tbl3.

    Build the base query, Q1, to join table 1 and 2.
    then use the query wizard , and it will ask you questions on how to build it.
    what source to use: Q1
    tell it the columns to use for the rows (4 fields may be the limit)
    what field to use as columns (DX CODE)
    and what to use as the intersecting VALUE,
    once built ,edit the query and change the VALUE field from SUM to FIRST.

  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,929
    No, I don't think want to use the DX CODE as column header.

    What is needed for a CROSSTAB is a group sequence ID to use as the column header. This can be generated with DCount(). Review https://www.accessforums.net/showthread.php?t=66314 and https://stackoverflow.com/questions/...01975#47801975
    Last edited by June7; 12-21-2017 at 02:22 PM.
    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.

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

Similar Threads

  1. Replies: 2
    Last Post: 02-29-2016, 03:00 PM
  2. merging fields
    By Jen0dorf in forum Access
    Replies: 9
    Last Post: 08-23-2015, 01:47 PM
  3. Merging fields in a table
    By Bx Snipe in forum Access
    Replies: 1
    Last Post: 09-24-2012, 01:45 PM
  4. Replies: 2
    Last Post: 02-28-2012, 12:43 PM
  5. merging two fields
    By brandon in forum Access
    Replies: 5
    Last Post: 06-09-2010, 08:17 AM

Tags for this Thread

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