none
concatenate forward slash with int columns data type RRS feed

  • Question

  • Hi,

    I'm trying to concatenate INT/TINYINT columns with '/' sign (forward slash).

    the error I get is:

    Conversion failed when converting the varchar value '/' to data type tinyint

    how can I concatenate it all together?

    Regards

    Monday, August 4, 2014 8:57 AM

Answers

  • You have to convert first the int/tinyint values into varchar, before you can concatenate them

    SELECT CONVERT(varchar, MyIntColumn1) + '/' + CONVERT(varchar, MyIntColumn2)


    Olaf Helper

    [ Blog] [ Xing] [ MVP]

    Monday, August 4, 2014 9:09 AM

All replies