473,395 Members | 1,348 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Crosstab query: Concatenate results rather than count

I've got a crosstab query that counts the number of values in one of my
tables. However, rather than giving me the number of instances of each
record, what I would like is for each value to display, separated by a
comma. For example, in the query is a row is named BC and a column named
Vancouver, it currently displays "4" for the number of instances that
Vancouver appears combined with the BC field. However, what I would like to
display instead of the count is "Vancouver, Vancouver, Vancouver, Vancouver"
etc. I've tried changing the Total function to "First" or "Last" which sort
of works however this only gives me one record when I need all the records
to display.

If anyone can help me out with the SQL or even let me know if this can be
done, I would appreciate it. Here's a more of a visual display of the issue
(hopefully the formatting works):

What currently displays:

Column: Vancouver
Row: BC 4
Desired Display:
Column: Vancouver
Row: BC Vancouver, Vancouver, Vancouver, Vancouver
Thanks for any advice.
Nov 13 '05 #1
1 6551
On Thu, 23 Sep 2004 14:53:30 -0700, "Big Time"
<bi************@remove-for-spam-hotmail.com> wrote:
I've got a crosstab query that counts the number of values in one of my
tables. However, rather than giving me the number of instances of each
record, what I would like is for each value to display, separated by a
comma. For example, in the query is a row is named BC and a column named
Vancouver, it currently displays "4" for the number of instances that
Vancouver appears combined with the BC field. However, what I would like to
display instead of the count is "Vancouver, Vancouver, Vancouver, Vancouver"
etc. I've tried changing the Total function to "First" or "Last" which sort
of works however this only gives me one record when I need all the records
to display.

If anyone can help me out with the SQL or even let me know if this can be
done, I would appreciate it. Here's a more of a visual display of the issue
(hopefully the formatting works):

What currently displays:

Column: Vancouver
Row: BC 4
Desired Display:
Column: Vancouver
Row: BC Vancouver, Vancouver, Vancouver, Vancouver
Thanks for any advice.

Don't think you can do this in SQL though I am now more cautious is
saying this after seeing Joe Cellco's stuff on nested sets.

Have a look at the Access Web under "Modules: Concatenate fields in
same table" which is at http://www.mvps.org/access/modules/mdl0008.htm

David

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Donna Sabol | last post by:
First, I should start by saying I am creating a database to be used by some very impatient, non-computer literate people. It needs to be seameless in it's operation from their point of view. I...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
2
by: carl.barrett | last post by:
Hi, I'm back with the same question as I still can't get it to display my data the way I want it to. The table lists information about a perpetrator involved with an anti social behaviour...
8
by: Penny | last post by:
(Access 2003 Multiuser Split DB, Windows XP Pro) Hi All, I would really appreciate just some basic tips on how to make a Crosstab Form based on a Crosstab Query. The query always has the same...
6
by: tizmagik | last post by:
I am having a lot of difficulty generating a CrossTab Query based report. I have looked online for several tutorials and whatnot but I have not been able to really find what I'm looking for, nor...
13
by: salad | last post by:
Operating in A97. I didn't receive much of a response conserning Pivot tables in Access. Pivot tables are nice, but a CrossTab will work for me too. Using a Pivot table, one is actually...
1
by: bruce24444 | last post by:
First of all I'm new to the forum and am working on my first database. So far I think I've done not too bad but have hit a stumbling block for which I'm not sure how to get around. What I have is...
1
by: bobykim | last post by:
Hi All, I'm using MS Access 2003 in a Windows XP environment. I've created an aging report for my department that is based on what I call the "Main query" with an IIf statement that allows the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.