SELECT CAST(SUBSTRING(loanAmount, PATINDEX('%[^0 ]%', loanAmount + ' '), LEN(loanAmount))AS INT) FROM [dbCMSextract].[dbo].[tblLoanMaster_copy]
Msg 245, Level 16, State 1, Line 1<br /> Conversion failed when converting the varchar value '1.00' to data type int.
CAST('00001.00' as float)
SELECT CAST( CAST('00001.00' as float) as int)
SELECT CAST(ROUND('00001.00',0,1) AS INT)
SELECT Cast(Cast(SUBSTRING('1.00', PATINDEX('%[^0 ]%', '1.00' + ' '), LEN('1.00')) as Decimal) as Int)
SELECT Cast(Cast(SUBSTRING('1.00', PATINDEX('%[^0 ]%', '1.00' + ' '), LEN('1.00')) as float) as Int)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)