Solved

Concatenation in MS Access SQL View

Posted on 2013-10-29
4
2,310 Views
Last Modified: 2013-11-15
Hello,

I just modified a report in MS Access (2010) originally developed by another (already gone) person.

I inserted a new field to the already existing report, containing various tables. All very simple and it woks perfectly fine. However, when I wanted to concatenate the results of that field into one row I just Couldn't!!! I tried several functions and even tried the listagg function that works for Oracle 11.2g (which we have), but no luck.

Since the report  is based on Access' SQL View and not in VBA, I had to go to that view to manually try to insert a concatenating function, but none of them seem to be supported.

When I run the query this is what I get:

NAME             TRACKER
John Doe         SKS
John Doe         LHN
John Doe         JM

What I would like to see, as you probably now, is:
NAME             TRACKER
John Doe        SKS, LHN, JM

Is there a way to do it in Access by using the SQL view at all? Is there another way?
Please help!!! I am stuck here.

Thanks
0
Comment
Question by:panterall
  • 2
4 Comments
 
LVL 119

Assisted Solution

by:Rey Obrero
Rey Obrero earned 200 total points
ID: 39609707
0
 
LVL 61

Accepted Solution

by:
mbizup earned 300 total points
ID: 39611092
Similar technique with a detailed explanation and custom aggregate function for concatenating records by group, written by matthewspatrick here:
http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_2380-Domain-Aggregate-for-Concatenating-Values-by-Group-in-Microsoft-Access.html

<<Is there a way to do it in Access by using the SQL view at all? Is there another way?>>

There is no native method to do this in Access SQL, as there may be in Oracle or other database platforms, so the workaround is to use custom VBA functions and include those functions in your queries.

If you find the article helpful, please click the 'Yes' button at the bottom.
0
 
LVL 1

Author Comment

by:panterall
ID: 39622319
Hello capricorn1 and mbizup!!
Thanks for your quick answer. I apologize I didn't answered before, but work has been crazy and I hadn't had the chance to try out your solutions.

I am working on them today and I will get back to you to let you know what I did.
I have to say that these solutions look pretty awesome and just probably what I needed.

Thanks a lot again.
0
 
LVL 1

Author Comment

by:panterall
ID: 39651690
Wow! I tried both solutions and both worked out well for my issue.
I have to say that I am very impressed since I have never expected this could be done this way.

I like mbizup's detailed solution, but also I like capricorn1's concise solution.

Thanks a million guys!!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now