Results 1 to 6 of 6
  1. #1
    cnstarz is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    31

    Help merging multiple rows into one row/concat'ing single field

    In my simple database, I keep track of tasks. Each task might have multiple notes. In my report, I want it to show each task only once and I want notes concatenated somehow into a single field. For instance, my report currently looks like this:



    TaskName Task Desc Start Date End Date Notes
    San Antonio Something 1/1/2011 1/2/2011 ALF
    San Antonio Something 1/1/2011 1/2/2011 Note 1
    Albuquerque ABQ Note 2/2/2012 2/3/2012 Note 2
    Albuquerque ABQ Note 2/2/2012 2/3/2012 Heartbleed
    Albuquerque ABQ Note 2/2/2012 2/3/2012 Note 1
    Albuquerque ABQ Note 2/2/2012 2/3/2012 Konami
    Dallas I hate Dallas 3/3/2013 3/4/2013 Crest
    Apple Destroy Apple. 4/4/2014 4/5/2014 OCC
    Apple Destroy Apple. 4/4/2014 4/5/2014 Peanut Butter

    But I want it to look like more condensed like this:

    TaskName Task Desc Start Date End Date Notes
    San Antonio Something 1/1/2011 1/2/2011 ALF, Note 1
    Albuquerque ABQ Note 2/2/012 2/3/2012 Note 2, Heartbleed, Note 1, Konami
    Dallas I hate Dallas 3/3/2013 3/4/2013 Crest
    Apple Destroy Apple. 4/4/2014 4/5/2014 OCC, Peanut Butter


    How do I accomplish this? Attached is my database, just open the "Tasking Order Report" to see what I'm talking about. Thanks for your help!
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    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
    cnstarz is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    31
    Quote Originally Posted by June7 View Post
    Perfect -- thanks for the link!

    Although there's another problem in my database I ran into that's sort of related. In my join table (jtbTaskNotes), it only has records for tasks that have notes. However, I want the table to add a record for every Task created even if there are no notes for that task. How can I accomplish this so that I dont have to create a query that shows every Task record? Database is attached.
    Attached Files Attached Files

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    I guess when record is created in tbTasks, could have code that immediately saves record to jtbTaskNotes.

    But what's wrong with using a query that includes tbTasks?
    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.

  5. #5
    cnstarz is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Oct 2010
    Posts
    31
    Nothing wrong with the query, just figured it would be more efficient and resourceful if my database relied on one less query. I thought I had read somewhere that using outer joins weren't recommended (which is how the query works), so I was also trying to avoid that.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,926
    I don't know why outer join would be inadvisable, never read anything like that. Use them frequently. Don't see how a db could function without them.

    Then there is the argument against creating unnecessary records. This uses up file capacity more than a query statement.
    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: 11
    Last Post: 10-15-2013, 05:59 PM
  2. Replies: 5
    Last Post: 04-10-2012, 08:53 AM
  3. Replies: 2
    Last Post: 01-02-2012, 06:46 PM
  4. Replies: 5
    Last Post: 12-01-2011, 05:38 PM
  5. Access to Excel transferring multiple rows to single row
    By peter_lawton in forum Import/Export Data
    Replies: 10
    Last Post: 09-23-2009, 10:16 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