Results 1 to 4 of 4
  1. #1
    sellingherbal's Avatar
    sellingherbal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2013
    Location
    www.blogvietkieu.com
    Posts
    4

    How To Group This Table ?

    I have this table (it can be in Access or Excel).

    Name--ID--Email--Cat1--Cat2--Cat3

    Mr.A--1-- e@mail.com--wat--dfgf--uytyt


    Mr.A--1-- e@mail.com--some--fgdfd--fgfd
    Mr.A--1-- e@mail.com--stri---hgfgf--ghfgh
    Mr.A--1-- e@mail.com--fdgf--fddf--gdfdf
    Mr.B--1-- e@mail.com--fwat--vdfgf--xuytyt
    Mr.B--1-- e@mail.com--vsome--rfgdfd--xfgfd
    Mr.B--1-- e@mail.com--gstri---fhgfgf--gghfgh
    Mr.B--1-- e@mail.com--cfdgf--rfddf--sgdfdf

    and I want to keep all this information in 1 row like this (since there are 4 records for each)

    Name (Mr.A)--ID--Email--Cat1--Cat2--Cat3--Cat1--Cat2--Cat3--Cat1--Cat2--Cat3---Cat1--Cat2--Cat3
    Name (Mr.B)--ID--Email--Cat1--Cat2--Cat3--Cat1--Cat2--Cat3--Cat1--Cat2--Cat3---Cat1--Cat2--Cat3

    Thank you

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Unless there is an identifier that can be used select all 1 records, all 2 records, all 3 records, all 4 records, this won't be easy.

    You can use Allen Browne's ConcatRelated function to combine the data into a single string http://allenbrowne.com/func-concat.html.

    If you want to keep the data as discrete elements (separate fields), will need more complicated code and write records to a temp 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
    sellingherbal's Avatar
    sellingherbal is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2013
    Location
    www.blogvietkieu.com
    Posts
    4
    Quote Originally Posted by June7 View Post
    Unless there is an identifier that can be used select all 1 records, all 2 records, all 3 records, all 4 records, this won't be easy.

    You can use Allen Browne's ConcatRelated function to combine the data into a single string http://allenbrowne.com/func-concat.html.

    If you want to keep the data as discrete elements (separate fields), will need more complicated code and write records to a temp table.
    Thank you, I tried this method but got an error every time (even with the same numbers etc... in the thread's attached picture).
    http://stackoverflow.com/questions/1...alue-in-column

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    I tested the spreadsheet code with the example data from that thread and it works for me without error. What error do you get?

    It will certainly require some adjustment to deal with your 3 columns of data.
    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: 0
    Last Post: 02-25-2013, 04:43 PM
  2. Replies: 8
    Last Post: 08-06-2012, 10:23 PM
  3. Replies: 2
    Last Post: 06-21-2012, 07:40 PM
  4. Replies: 6
    Last Post: 07-20-2011, 11:54 AM
  5. Replies: 5
    Last Post: 05-17-2011, 11:02 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