Solved

Concatenation in MS Access SQL View

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

757 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

22 Experts available now in Live!

Get 1:1 Help Now