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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concating text by grouping reference number

Status
Not open for further replies.

dreamboy27

Programmer
Sep 25, 2006
16
0
0
US
Can any one help me in concating text field.

I have a problem in concating a text field which belongs to a same group ie reference number

Ex:

Ref.No Text

01 mirror
02 trunk
03 seat and
03 seat belt
04 tire
05 keys,
05 key chain and
05 battery

say this is my data base and my result should give as

01 mirror
02 trunk
03 seat and seat belt
04 tire
05 key,kay chain and battery

I want this in a sql statement, so that i can join this to my main sql and pull the text field.
In this I have to group all the Ref.No and concat the text belongs to the same Ref. No
Urgent plzzz
 
Hello,

Try the following:

1: Group the data by Reference Number
2: Create a formula Cummulative_Text to concatenate text,
WhilePrintingRecords;
StingVar temp= temp + {Table.text};
3: Place this formula in details section
4: Create a formula ResetTemp, to reset the string temp, on change of group
WhilePrintingRecords;
Stringvar temp;
If not inrepeatedgroupheader then temp:=””;
5: Place this formula in Group Header
6: Place the formula Cummulative_Text in Group Footer and drag the group header into group footer.
7: Suppress group header and details of the report.
 
Between the language barrier and your request for a SQL statement it's hard to figure out how to help you.

I suggest you go to the appropriate database forum for whatever SQL you're using, or at least post your database type here...

-k
 
this wont work because i have 15 fields in my report and i cant group that with Ref No. and this text field is my last field in the report ie 16th field
 
Try being more specific about the question. You've been given a method that ought to work. Saying this wont work could mean many things.

Have you actually tried following the advice you've been given?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top