Connecting Tech Pros Worldwide Forums | Help | Site Map

Converting String To Decimal

benchpolo's Avatar
Member
 
Join Date: Sep 2007
Location: Nevada
Posts: 92
#1: Sep 30 '09
I have a column SUBAMOUNT where the value is converted to text 0000008917'. When the file is received I need to convert it to decimal (0000008917 converted to 89.17. I tried to use the CAST TSQL command, but it is giving me a result of 8917.00, which is incorrect.

Thanks in advance for your assistance.

Delerna's Avatar
Expert
 
Join Date: Jan 2008
Location: Sydney
Posts: 788
#2: Sep 30 '09

re: Converting String To Decimal


convert(decimal(18,2),SUBAMOUNT)/100.0
Reply