Solved

Concatenation in MS Access SQL View

Posted on 2013-10-29
4
2,408 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 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

803 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