SQL print a space between concat statements

concatenation, sql

Solution

You don't mention what flavor of SQL you're using, but depending, you may need to convert the values to strings first. For SQLSever...

(Cast(NBR as varchar(20)) + ' ' + Cast(ACCT_NBR as varchar(20))) as acct,

Problem

Concatenating two columns together, Just want them to be displaying together in column with a space between the two numbers. It keeps adding the two numbers together. One is a bigint other is a smallint.Will be displayed in an SSRS report eventually but right now just using SQL to query the data ``` (NBR +''+ ACCT_NBR) as acct, ```

Original source