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

Concatenating fields

Status
Not open for further replies.

IanHallett

IS-IT--Management
Sep 27, 2001
15
GB
Hi,

I have a table with the following fields:

{InvoiceNumber} {Line Number} {Text}

There could be several records with the same Invoice Number, each of which will have a line number (i.e. 1,2,3, etc). The text field represents text notes added against an invoice so there could be several notes against each invoice.

I would like (ideally) to end up with one record or line per invoice which concatenates the text fields pertaining to that invoice, my data looks like the following:

{InvoiceNumber} {LineNumber} {Text}

1234 1 Text line 1
1234 2 Text Line 2
1234 3 Text Line 3

I would like to end up with one line as follows:

{InvoiceNumber} {Text}
1234 Text Line 1 Text Line 2 Text Line 3

I hope this all makes.
 
Group on invoice number and then create these formulas:

//{@reset} for the group header:
whileprintingrecords;
stringvar x;
if not inrepeatedgroupheader then
x := "";

//{@accum} to be placed in the detail section:
whileprintingrecords;
stringvar x := x + {table text} + " ";

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

Drag the groupname into the group footer and then suppress the group header and detail section.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top