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

Combine into one record

Status
Not open for further replies.

eebabe

IS-IT--Management
Jul 17, 2003
54
US
I would like to concatenate these records so that they are in one record like:
RECNO PTID ICD_TEXT
4 0002 TWO STAB WOUNDS TO BACK;L THIGH HEMATOMA;

RECNO PTID ICD_TEXT
4 0002 TWO STAB WOUNDS TO BACK
5 00003 L THIGH HEMATOMA
6 00004 MULTIPLE LACS
7 00004 R MIDDLE AND LOWER LOBE CONTUSION
8 00004 COMMINUTED R ORBITAL FLOOR FX
9 00004 FX OF R LAMINA PAPYRACEA

How can I do it? using while do loops? Can I program a paragraph mark in the formula?

Thanks.
 

Hi,
Code:
Select A.RECNO, A.PTID, A.ICD_TEXT & ";" & B.ICD_TEXT & ";"
From YourTable A, YourTable B
Where A.RECNO=4
  And B.RECNO=5


Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Do you really just want the first two rows concatenated? Or all of them for a particular group? You can create formulas like these:

//{@accum} for the detail section (suppress this);
whileprintingrecords;
stringvar x := x + {table.ICD_Text} + ";" ;

//{@reset} for the group header (if accumulating at a group level):
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@display} to be placed in the group footer (or report footer depending):
whileprintingrecords;
stringvar x;

Why create a return (chr(13))? You can just format the display formula to "can grow" and resize the width as you wish.

-LB
 


I thought the same thing, but just answered his specific question.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi lbass: Thank you. That worked. But for learning purposes, can this be done with while do loop? Like while {PTID} = groupmember do {ICD_Text}.

What do you think?
 
I've never used a while/do loop--maybe Skip or someone can help. What do you believe would be the advantage?

-LB
 



I am totally at a loss to see what field/value to group on to 'loop'.

Your example showed no such relationship.

You chose a UNIQUE example, rather absurd. Hence my reply: Specific and too the EXACT requirement.

Where is the generalization? Please state the LOGIC!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top