Results 1 to 5 of 5
  1. #1
    albert_leung is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    8

    Question Convert Row to Column

    I need to convert the following dataset from:

    ClmSys Code
    1111 V1
    1111 V2
    1111 V3
    2222 V2
    2222 H4
    2222 H4
    2222 P8
    3333 JV
    4444 AA
    4444 V3
    4444 V2


    4444 TT
    ....

    TO
    ClmSys Cod1 Cod2 Cod3 Cod4 ...
    1111 V1 V2 V3
    2222 V2 H4 H4 P8
    3333 JV
    4444 AA V3 V2 TT

    Please help me for that. Any idea like SQL or any way I can do that? Thanks.
    Albert

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    This tutorial shows how to do something like that. It concatenates data of multiple records to a single value. http://allenbrowne.com/func-concat.html

    To keep the data separate is a step beyond. You would have to write data to a table.
    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
    albert_leung is offline Novice
    Windows XP Access 2003
    Join Date
    Oct 2011
    Posts
    8

    Convert Row to Column

    Yeah, I need to separate the data as individual column. which is ClmSys, Cod1, Cod2, Cod3, and Cod4 are all individual column. Anyway I can do it without VBA?

    Code:
    ClmSys Cod1 Cod2 Cod3 Cod4 ... 
    1111    V1	  V2	  V3
    2222    V2    H4	  H4	  P8
    3333    JV
    4444    AA	  V3	  V2	  TT
    Thanks a lot.
    Albert

  4. #4
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 7 32bit Access 2007
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Looks like the question was throughly addressed in other thread. No, I see no way to do without VBA.
    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: 3
    Last Post: 09-28-2011, 04:29 PM
  2. Replies: 1
    Last Post: 08-18-2011, 08:35 AM
  3. sales DB selecting column and column range
    By pher77 in forum Queries
    Replies: 3
    Last Post: 06-11-2011, 04:04 PM
  4. Replies: 1
    Last Post: 03-14-2011, 10:04 AM
  5. Replies: 1
    Last Post: 04-15-2010, 02:07 AM

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