Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatenate multiple rows into single row 1

Status
Not open for further replies.

pl1101

Programmer
Dec 5, 2009
46
I need to convert multiple row into a single column separated by commas. I read another thread that tells me how to do it, but the comma is either is added to the end. How do I stop the comma from appearing at the end.

Example:
Id
1
2
3
4
4

Need to display:
id
1,2,3,4,4

It currently displays:
1,2,3,4,4,

I used thread# 767-1478748 to get the above results.

Thank you in advance. I really appreciate your help!
 
For the display formula, use:

whileprintingrecords;
stringvar x;
left(x,len(x)-1)

To create a link to a previous thread, write the word "thread" followed immediately by the thread number (no space), as in thread767-1478748.

-LB
 
I added this code to the display and then I get an error message: "String length is less than zero or not an integer". Where and how do I check for zero length?
 
The comma still is at the end of the string.
 
whileprintingrecords;
stringvar x;
if len(x) >= 1 then
left(x,len(x)-1)

This assumes you added a comma with no space (as shown in your sample). If there was a space, change it to -2. This formula belongs in the group footer.

-LB
 
I need to display a date of Thursday of the current week. How do I do this? Please help!
Example: if it is Tuesday, Feb 23, 2010, I need to display 2/25/2010
 
Please start a new thread as this is a different topic.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top