473,387 Members | 1,497 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,387 software developers and data experts.

Concatenate multiple rows into one string

Hi,

I have the following table:

Project Name email_addr
happy ja********@happy.com
happy jo********@lappy.com
happy ma********@happy.com
sad jo********@lappy.com
paper ma********@happy.com
paper jo*******@happy.com

What I would like to end up with is if I select project happy is:

ja********@happy.com;jo********@lapp... **@happy.com

Any help would be greatly appreciated.

Thanks
Nov 13 '05 #1
4 5847
On 18 Jun 2004 07:08:47 -0700, Sm******@aol.com (Smythe32) wrote:

You'll have to do that with a recordset: open a recordset on a query
that pulls the right rows, then loop over it, and for each row add the
email address and a semicolon to a string variable. At the very end
remove the last semicolon.

-Tom.

Hi,

I have the following table:

Project Name email_addr
happy ja********@happy.com
happy jo********@lappy.com
happy ma********@happy.com
sad jo********@lappy.com
paper ma********@happy.com
paper jo*******@happy.com

What I would like to end up with is if I select project happy is:

ja********@happy.com;jo********@lappy.com;ma***** ***@happy.com

Any help would be greatly appreciated.

Thanks


Nov 13 '05 #2
Tom van Stiphout <to*****@no.spam.cox.net> wrote in message news:<57********************************@4ax.com>. ..
On 18 Jun 2004 07:08:47 -0700, Sm******@aol.com (Smythe32) wrote:

You'll have to do that with a recordset: open a recordset on a query
that pulls the right rows, then loop over it, and for each row add the
email address and a semicolon to a string variable. At the very end
remove the last semicolon.

-Tom.

There's an example of this here:
http://www.mvps.org/access/modules/mdl0004.htm
or here..
http://www.mvps.org/access/modules/mdl0008.htm
Nov 13 '05 #3
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf*************************@posting.google.c om>...
Tom van Stiphout <to*****@no.spam.cox.net> wrote in message news:<57********************************@4ax.com>. ..
On 18 Jun 2004 07:08:47 -0700, Sm******@aol.com (Smythe32) wrote:

You'll have to do that with a recordset: open a recordset on a query
that pulls the right rows, then loop over it, and for each row add the
email address and a semicolon to a string variable. At the very end
remove the last semicolon.

-Tom.

There's an example of this here:
http://www.mvps.org/access/modules/mdl0004.htm
or here..
http://www.mvps.org/access/modules/mdl0008.htm

I am unable to get this code to work. I think it has something to do
with I am looking at a string instead of a long.
Nov 13 '05 #4
Sm******@aol.com (Smythe32) wrote in message news:<7f**************************@posting.google. com>...
pi********@hotmail.com (Pieter Linden) wrote in message news:<bf*************************@posting.google.c om>...
Tom van Stiphout <to*****@no.spam.cox.net> wrote in message news:<57********************************@4ax.com>. ..
On 18 Jun 2004 07:08:47 -0700, Sm******@aol.com (Smythe32) wrote:

You'll have to do that with a recordset: open a recordset on a query
that pulls the right rows, then loop over it, and for each row add the
email address and a semicolon to a string variable. At the very end
remove the last semicolon.

-Tom.

There's an example of this here:
http://www.mvps.org/access/modules/mdl0004.htm
or here..
http://www.mvps.org/access/modules/mdl0008.htm

I am unable to get this code to work. I think it has something to do
with I am looking at a string instead of a long.


Sounds like you're not passing the right value to the function - if
you specify that the field is a string, it should add the delimiters
for you. Or of course, you could do as Tom suggested...
Nov 13 '05 #5

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

Similar topics

0
by: Nick Heppleston | last post by:
I have a concatenation problem and I was wondering if somebody might be able to offer some help :-) I have the following table structure holding product long descriptions: Part...
5
by: gwarning! | last post by:
Goal: Have multiple text files, each of various lengths, be concatenated together into one final consolidated text file. Problem: Since the names of the files to be concatenated can change from...
5
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all...
1
by: sneha123 | last post by:
There will be some 20 questions and for each question there will be 4 choices.what i want to do is to select multiple answers by clicking the checkbox. i m using asp.net,vb.net pls help me we...
4
by: Dave Edwards | last post by:
I understand that I can fill a datagrid with multiple queries, but I cannot figure out how to fill a dataset with the same query but run against multiple SQL servers, the query , table structure...
14
by: metamorphiq | last post by:
Hello, I'm a Java programmer, so I'm probably asking a very simple question here, but I have trouble solving it :) I'd like to know how you concatenate multiple (4, in my case) char* in C++,...
1
by: dhyder | last post by:
OK, like the title says my error is Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. I have looked into this a lot, but have not...
3
by: gyap88 | last post by:
My search engine in visual basic 2005 has 4 textbox for users to input values, named textbox1,textbox2,textbox3,textbox4. I have a string assigned to each of the textbox named...
10
by: Aaron Hoffman | last post by:
Hello, I'm hoping someone might be able to offer some guidance to my problem. I have one query in MS Access which consists of 2 tables joined by a SEQUENCE_ID. By joining the two tables I am...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.