• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 633
  • Last Modified:

Concatenate Database Fields

I have a database table with the fields

STN0       LN                  Text
ST1           1                    Line 1 Text
ST1           2                    Line 2 Text
ST1           3                    Line 3 Text
ST1           4                    Line 4 Text

I want to concatenate the fields so I get the output :

STN0       Text.......

ST1         Line 1 Text Line 2 Text Line 3 Text Line 4 Text

Can someone please suggest a function to do this.
0
Northumberland
Asked:
Northumberland
  • 3
  • 2
1 Solution
 
mlmccCommented:
Are these separate records in the database?

Which version of Crystal?

mlmcc
0
 
NorthumberlandAuthor Commented:
10.0
0
 
NorthumberlandAuthor Commented:
They are also seperate fields
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
frodomanCommented:
I assume that you're grouping the report based on STN0 (If not then you probably will need to do so).  You can then use ST1 in your details section and create a formula in your details section like this:

shared stringVar sText;
sText := sText + ' ' + {table.ST1};

Now in the group footer create a formula to display the concatenated text:

shared stringVar sText;

And in the group header create a formula to reset it:

shared stringVar sText := '';


HTH

frodoman
0
 
NorthumberlandAuthor Commented:
Excellent answer - thanks very much !
0
 
frodomanCommented:
Glad to help.
0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now