Remove Zero In A Column
I have created a table with a column of type nvarchar(max): CREATE TABLE Table1 (Col1 nvarchar(max)) INSERT table1 values('A001') INSERT table1 values('A005') INSERT table1 values
Solution 1:
You Can try Like this,,,
SelectLEFT(Col1, 1)+Cast(CAST(Replace(Col1,'A','') asInt) as nvarchar(Max)) as Col1 from Table1
Solution 2:
selectleft(Col1,1)+ltrim(convert(int,substring(Col1,2,99)))
Post a Comment for "Remove Zero In A Column"