Results 1 to 4 of 4
  1. #1
    William McKinley is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2010
    Posts
    59

    Help! Transposing Data via Cross Tab Query?

    Hi All,



    I have a requirement to transpose my warehouse storage locations into logical groupings to print new labels. I was doing this by hand in Excel, but unfortunately it's taking way to long and I have to do 19,000 by today. Help! Here's what I'm trying to do:

    I have a list of storage locations that looks like the below. I need to come up with some kind of logic in a query to reorganize the data so that the printer can efficiently produce the labels. Basically the storage location is broken into 3 sections, separated by a . The first section is the Aisle(150,151). The second section is the Bay (001,002). The third and final section is the Location (100,200,300). The data needs to be structured so that every Each Aisle and Bay is split to a new row of the query results, with the Location numbers ascending from smallest to largest.

    Can anyone think of a way to do this? I'm stumped right now and time is running out

    Need it to look like this:

    150.001.100. 150.001.200. 150.001.300.
    150.002.100. 150.002.200. 150.002.300.
    151.001.100. 151.001.200. 151.001.300.
    151.002.100. 151.002.200. 151.002.300.


    Old Data Structure:
    150.001.100.
    150.001.200.
    150.001.300.
    150.002.100.
    150.002.200.
    150.002.300.
    151.001.100.
    151.001.200.
    151.001.300.
    151.002.100.
    151.002.200.
    151.002.300.

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Assuming your table name is tblLocationCode and your field name is LocationCode

    Use this query:

    Code:
    TRANSFORM Max(tblLocationCode.LocationCode) AS MaxOfLocationCode
    SELECT Left([locationcode],3) AS Asile, Mid([locationcode],5,3) AS Bay
    FROM tblLocationCode
    GROUP BY Left([locationcode],3), Mid([locationcode],5,3)
    PIVOT Right([locationcode],3);

  3. #3
    William McKinley is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2010
    Posts
    59
    The query is structured correctly, however the output is not quite there. Instead of showing all of the storage locatiosn for that Aisle and Bay, it only shows the Max. Any ideas? Here's what it looks like:

    150 001 150.001.300.
    150 002 150.002.300.
    151 001 151.001.300.
    151 002 151.002.300.

  4. #4
    William McKinley is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2010
    Posts
    59
    Never mind, I figured it out. the Right([locationcode],3) needed to be switched to Right([locationcode],4).

    Thanks so much for the help!

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

Similar Threads

  1. transposing data in a report
    By brianrunsphilly in forum Reports
    Replies: 3
    Last Post: 10-23-2013, 02:22 PM
  2. "transposing vertical data into horizontal columns"
    By stevelondon in forum Queries
    Replies: 3
    Last Post: 03-20-2012, 12:36 PM
  3. Replies: 1
    Last Post: 06-18-2011, 10:00 AM
  4. Replies: 0
    Last Post: 07-20-2010, 12:44 PM
  5. Transposing Data
    By NoiCe in forum Queries
    Replies: 0
    Last Post: 11-09-2008, 05:24 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