If you are unable to create a new account, please email support@bspsoftware.com

 

How to concatenate two fields with different datatypes in report studio??????

Started by rr.bi1212, 19 Feb 2012 06:13:11 PM

Previous topic - Next topic

rr.bi1212

Hi,
My Question is how to concatenate two fields with different datatypes (i.e integer and varchar) in report studio??????

The Result should display in this way........field1 - field2.

HalfBloodPrince

Use Cast([column name],VARCHAR(<length>) ) to convert integer column to Character. then you can concatenate.

For Eg. cast([Amount],varchar(10))


rr.bi1212

Half Blood Prince

I am concatenating at the field level so can you please tell me how to convert and concatenate it.

HalfBloodPrince

cast([Field1],varchar(10) ) +'-' +[Field2]

assumed Field 2 is character

rr.bi1212


Lynn

Another option is to unlock your report layout and drag the items in separately. If the requirement is simply to display field1 - field2 in the layout then you don't have to cast and concatenate in the query. Just drag them in as desired and use a text item for the hyphen between them.