Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Concatenate two fields

I have these two fields in a dataset. How can I concatenate these in Crystal Reports to display next to each other?

select 
  CAST(T.GLTR_PSTNG_TYPE AS VARCHAR) REF_NO, 
  CAST(T.GLTR_DOC_CODE AS VARCHAR) GLTR_OUR_DOC_NO    
from dom
like image 329
DX. Avatar asked Dec 28 '09 05:12

DX.


People also ask

Can you concatenate fields in SQL?

In the output of SQL Server Concatenate using SQL Plus (+) operator, we have concatenate data from these fields (firstname, MiddleName and LastName) as a new column FullName. We have a drawback in SQL Server Concatenate data with SQL Plus(+) operator.


1 Answers

You will need to create a FORMULA to concatenate these strings.

In the Field Explorer , right click the Formula Fields and select New.

It will prompt you for a Formula Name. Enter the name of your choice, and hit enter.

In the Formula Workshop screen select the 2 fields you require to concat from the Datasource, drag them down to the edit section. The formula should look something like this

{YourDataSource.Field1} & " " & {YourDataSource.Field2}

Click Save and Close.

Now you can drag the Formula Field onto the report to view.

like image 119
Adriaan Stander Avatar answered Sep 19 '22 14:09

Adriaan Stander