Home Forums SQL Server 2008 T-SQL (SS2K8) convert varchar to numeric RE: convert varchar to numeric
lduvall
SSCarpal Tunnel
Points: 4869
More actions
February 22, 2012 at 10:31 am
#1450440
Finally got it! I'm not sure if this is the best way, but it worked for me:
select CONVERT(NUMERIC(3,0),(CONVERT(int,SUBSTRING(Col4,1,CHARINDEX('%',Col4)-1))))/100
FROM Executive.StagedimWeight
WHERE Col4 IS NOT NULL
AND Col4 LIKE '%\%%'ESCAPE '\'