sql server 2008 - Concatenate two SQL fields with text -


how can concat 2 fields , text in between? i've tried of following , nothing has worked...

([fldcode1] || ':' ||[fldcode2]) method  ([fldcode1] + ':' + [fldcode2]) method  ([fldcode1] & ':' & [fldcode2]) method                                                 *** & cannot used varchar  

this should work

select [fldcode1] + ':' + [fldcode2] tab 

or if columns numeric

select cast([fldcode1] varchar(100)) + ':' + cast([fldcode2] varchar(100)) tab 

Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -