concatenating fields with dash in the middle

  • New to sql server 2008 and beginning programmer. Trying to concatenate two fields with a "-" dash in between the values

    kp_ProcessLevelIdName + '-' + kp_reviewtype AS "Process",

    getting this error:
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the nvarchar value 'Coverage Determination-' to data type int.

    Coverage Determination is one of the values in the kp_processlevelidname field

    any suggestions?

    Thanks!

  • pierre.m.adler - Wednesday, December 20, 2017 4:48 PM

    New to sql server 2008 and beginning programmer. Trying to concatenate two fields with a "-" dash in between the values

    kp_ProcessLevelIdName + '-' + kp_reviewtype AS "Process",

    getting this error:
    Msg 245, Level 16, State 1, Line 1
    Conversion failed when converting the nvarchar value 'Coverage Determination-' to data type int.

    Coverage Determination is one of the values in the kp_processlevelidname field

    any suggestions?

    Thanks!

    Yes, you need to convert the integer column to a character value, cast(kp_reviewtype as varchar(10)).

  • thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply