Skip to content Skip to sidebar Skip to footer

Convert Numeric Value To Varchar

I'm trying to fetch the records and append some letters to my numeric column, but I'm getting an error. I tried with cast and convert function. For example: select convert(varchar(

Solution 1:

i think it should be

selectconvert(varchar(10),StandardCost) +'S'from DimProduct where ProductKey =212

or

selectcast(StandardCost asvarchar(10)) +'S'from DimProduct where ProductKey =212

Solution 2:

First convert the numeric value then add the 'S':

selectconvert(varchar(10),StandardCost) +'S'from DimProduct where ProductKey =212

Post a Comment for "Convert Numeric Value To Varchar"