+ Reply to Thread
Results 1 to 6 of 6

Transpose horizontal table to a vertical table via query

  1. #1
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Transpose horizontal table to a vertical table via query

    Hi all,

    The dates in TblHorizontal are required to be enter in this way due to a funky form layout, however, it need to be converted into a TblTableVertical table.

    Please Login or Register  to view this content.
    To

    Please Login or Register  to view this content.
    Now, while I could write a loop in VBA, but would much prefer to use a query.

    I've attempted to use a crosstab but keep failing due to field number (I have around 36 date fields).

    Can anybody offer a solution please?

    Cheers

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Transpose horizontal table to a vertical table via query

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    Cheers!
    Deep Dave

  3. #3
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Transpose horizontal table to a vertical table via query

    BTW Which query are you talking about?

    Give this a try once..

    Please Login or Register  to view this content.
    See the attached file
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: Transpose horizontal table to a vertical table via query

    Thank you for your response NeedForExcel. Unfortunately, the answer provided, while useful for Excel, is not useable in MS Access, the forum for which being where I posted this thread. But I thank you for the effort nonetheless.

    For those interested in the answer to this question, I came upon a query design. It looks like this:

    Please Login or Register  to view this content.
    This query works exactly as intended. However, it might be somewhat too slow for the large number of fields, for a large database.

    I can use this in the meantime but if anybody can provide a better query, I'd certainly like to hear it. (An Access query, to clarify the application)

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: Transpose horizontal table to a vertical table via query

    @Journeyman3000

    Your solution in the above post. A union query is the only way I know of without using VBA. It may be time consuming. I have experienced it myself, but it is the answer.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  6. #6
    Forum Contributor
    Join Date
    03-05-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    301

    Re: Transpose horizontal table to a vertical table via query

    Thanks Alan,

    I do run this and it works fine. my users will just have to get a coffee while waiting.
    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. 3 criteria for horizontal and vertical matching from a table
    By mator in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-24-2014, 06:28 AM
  2. [SOLVED] How to get a result from a table (vertical+horizontal)
    By Loreleii7 in forum Excel General
    Replies: 4
    Last Post: 09-09-2014, 10:54 AM
  3. [SOLVED] Horizontal and vertical VLOOKUP in a table
    By Bax in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-27-2014, 07:10 AM
  4. [SOLVED] Turning a Vertical Table into a Horizontal one
    By Rob8489 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-11-2013, 10:03 AM
  5. [SOLVED] Reformat vertical table to a horizontal table
    By roversfan09 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-25-2013, 12:28 AM
  6. [SOLVED] Convert Horizontal Table to Vertical List
    By TXboiler in forum Excel General
    Replies: 3
    Last Post: 04-22-2011, 09:27 PM
  7. Reformat a vertical data set to a horizontal table
    By zenmeta4 in forum Excel General
    Replies: 2
    Last Post: 06-04-2009, 03:55 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1