Results 1 to 2 of 2
  1. #1
    Skhaliq is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2015
    Posts
    7

    Transpose a table using query in Access


    I have the table1, i want to transpose it as shown in table1_1, can anyone tell me the query/function that can be used to do this
    table 1
    FileName ObjectName Column1 Column2 Column3 Column4 Column5

    F1 Line1 A B C D E
    F1 Line2 F G H I J
    F1 Line3 K L M N O


    table1_1


    FileName ObjectName Column Data
    F1 Line1 Column1 A
    F1 Line1 Column2 B
    F1 Line1 Column3 C
    F1 Line1 Column4 D
    F1 Line1 Column5 E
    F1 Line2 Column1 F
    F1 Line2 Column2 G
    F1 Line2 Column3 H
    F1 Line2 Column4 I
    F1 Line2 Column5 J
    F1 Line3 Column1 K
    F1 Line3 Column2 L
    F1 Line3 Column3 M
    F1 Line3 Column4 N
    F1 Line3 Column5 O

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,815
    Use a UNION query. Must type or copy/paste in SQL View of query builder. Limit of 50 SELECT lines.

    SELECT FileName, ObjectName, "Column1" AS Column, Column1 AS Data FROM tablename
    UNION SELECT FileName, ObjectName, "Column2", Column2 FROM tablename
    UNION SELECT FileName, ObjectName, "Column3", Column3 FROM tablename
    UNION SELECT FileName, ObjectName, "Column4", Column4 FROM tablename
    UNION SELECT FileName, ObjectName, "Column5", Column5 FROM tablename;

    UNION will eliminate duplicate rows. If any of the data is duplicated and you want ALL values regardless, then use UNION ALL.
    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. Access 2010 Transpose and smoothed data
    By ENNIN12 in forum Access
    Replies: 5
    Last Post: 01-26-2017, 10:04 AM
  2. Access Transpose Query Help
    By deepakes2 in forum Queries
    Replies: 2
    Last Post: 07-11-2016, 09:50 AM
  3. Transpose Data of single table
    By Atif Mahmood in forum Access
    Replies: 4
    Last Post: 05-05-2016, 04:50 AM
  4. Transpose specific records to table (VBA)
    By KP_SoCal in forum Programming
    Replies: 2
    Last Post: 02-27-2013, 09:31 PM
  5. Transpose data in MS Access
    By JBLoafer in forum Access
    Replies: 12
    Last Post: 03-05-2012, 02:45 PM

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