Results 1 to 11 of 11
  1. #1
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338

    Transpose Data

    Hello



    I have a report that looks like this

    Patientname ICD 1 ICD 2 ICD 3 ICD 4 ICD 5
    John Doe 719.46 729 750
    How can i transpose the data.
    Patient name Order of ICD Code
    John Doe ICD 1 719.46
    John Doe ICD 2 729
    John Doe ICD 3 750

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can you just rearrange the textboxes vertically?
    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
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    June7

    I can rearrange it in access???

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    You can rearrange and resize controls on form or report any way you like, as long as they are not 'grouped' and not Datasheet View (on form). Even associated labels and boxes can be reconfigured to your 'transposed' arrangement. I know you have built forms and reports, why does this confuse you?
    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
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    The report is coming from another systems not access. Sorry i should have been more clear. I have the data in excel and i would like to transfer it to access.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Comment still applies. Bind report to that data source and rearrange the controls.

    If you want to have the data actually saved in the vertical (normalized) structure, need a UNION query to rearrange. Then either use the UNION query as source for subsequent queries or report data OR make a table from the UNION.

    We already discussed UNION in https://www.accessforums.net/queries...66/index2.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.

  7. #7
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    yes we did discussed UNION query before. Not sure how you did it. You just gave me the SQL.

  8. #8
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Last line from post 27 of that thread:

    There is no wizard for UNION query, must type in the SQL View of query designer.
    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.

  9. #9
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    I think i got it

    SELECT [Provider Name], [Patient name], "ICD91" AS Category,ICD91 as Data FROM CODE
    WHERE [ICD91] Is Not Null
    UNION SELECT [Provider Name], [Patient name], "ICD92" AS Category, ICD92
    FROM CODE
    WHERE [ICD92] Is Not Null;

    Does this look right??? It looks like it's pull the right data. Just want to make sure i'm not missing anything.

    Thank you

  10. #10
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Looks good. Be aware that a UNION query will eliminate duplicate records unless the ALL parameter is used. If the selected fields result in more than one record having the same combination of data, the 'duplicates' will be rejected. Including a unique identifier in the selected fields will prevent 'duplicates'.

    UNION ALL SELECT ...
    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.

  11. #11
    Ray67 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    338
    Thank you very much.

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

Similar Threads

  1. Transpose specific records to table (VBA)
    By KP_SoCal in forum Programming
    Replies: 2
    Last Post: 02-27-2013, 09:31 PM
  2. Query to transpose Data in Columns to Rows
    By ace1259 in forum Access
    Replies: 2
    Last Post: 04-10-2012, 01:49 PM
  3. Transpose data in MS Access
    By JBLoafer in forum Access
    Replies: 12
    Last Post: 03-05-2012, 02:45 PM
  4. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  5. Replies: 3
    Last Post: 06-20-2011, 03:09 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