I am trying to add string "Rs" with amount column. The data type of amount is integer. But Sql is not allowing me to concatenate string with int data type column.Image 1
1 Answer
You need to explicitly convert the int to varchar before concatenating with any string
select 'RS'+cast(total_amount as varchar(100)),*
from yourtable
If you are sql server 2012+ then use CONCAT which does implicit conversion
select Concat('RS',total_amount),*
from yourtable
1 Comment
Saqib
Thank you so much!