Results 1 to 10 of 10
  1. #1
    virgovibe is offline Novice
    Windows XP Access 2016
    Join Date
    Mar 2019
    Posts
    5

    Join Rows together in Access

    Hello,

    I have a table which I'd like to join text fields together based on One "Opportunity #" - I'm unfamiliar with SQL so I use a bunch of Functions in Access. How can I join the Max Service Line together to show Technology, Media?

    Click image for larger version. 

Name:	Capture.PNG 
Views:	13 
Size:	16.0 KB 
ID:	37770

    Table Name: Max Service Line



    Opp Number Max Service Line
    5555 Technology
    5555 Loyalty

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    virgovibe is offline Novice
    Windows XP Access 2016
    Join Date
    Mar 2019
    Posts
    5
    Quote Originally Posted by pbaldy View Post

    I've taken a look at that but I was unable to get it to work. I'm not very experienced in SQL code so I kept having errors in my code re-write.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Hard to fix errors without knowing what they are, or the specific way you incorporated this function. It would be called from a query that returned a single record for each opportunity number.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    virgovibe is offline Novice
    Windows XP Access 2016
    Join Date
    Mar 2019
    Posts
    5
    Would you be able to provide an example of the code using the details I provided? I’m sure the the attempt I made was incorrect since I didn’t understand the SQL code so it wouldn’t help to show it.

    Table name: max service line
    Unique field (its listed once): opportunity number
    Field which can have multiple results which I’d like to “join”: max service line

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Never hurts to show attempt for analysis.

    The ConcatRelated function can be called in query or textbox.

    In query like:

    SELECT [opportunity number], First(ConcatRelated("[max service line]", "[MAX SERVICE LINE]", "[opportunity number]='" & [opportunity number] & "'")) AS Services FROM [MAX SERVICE LINE] GROUP BY [opportunity number];
    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.

  7. #7
    virgovibe is offline Novice
    Windows XP Access 2016
    Join Date
    Mar 2019
    Posts
    5
    Quote Originally Posted by June7 View Post
    Never hurts to show attempt for analysis.

    The ConcatRelated function can be called in query or textbox.

    In query like:

    SELECT [opportunity number], First(ConcatRelated("[max service line]", "[MAX SERVICE LINE]", "[opportunity number]='" & [opportunity number] & "'")) AS Services FROM [MAX SERVICE LINE] GROUP BY [opportunity number];

    I get an error message: Undefined function "concatrelated" in expression

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Did you follow the "how to use this function" instructions?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    virgovibe is offline Novice
    Windows XP Access 2016
    Join Date
    Mar 2019
    Posts
    5
    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	23.5 KB 
ID:	37771

    Not sure whats going wrong here..

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    What june7 gave you was a query:

    Quote Originally Posted by June7 View Post
    In query like:
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 3
    Last Post: 06-30-2014, 12:53 AM
  2. Replies: 3
    Last Post: 05-14-2014, 01:30 PM
  3. Replies: 4
    Last Post: 01-24-2013, 12:11 AM
  4. Replies: 7
    Last Post: 09-15-2011, 01:58 PM
  5. Returning correct rows in a join/nested query
    By goneaccessing in forum Queries
    Replies: 5
    Last Post: 03-03-2010, 12:21 PM

Tags for this Thread

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