Error converting numeric values from varchar datatype to decimal
select
case PCI1__c
when ISNUMERIC(rtrim(ltrim(PCI1__c)))
then convert(decimal(10, 2), PCI1__c)
else null
end as PCI1__c
from
MX_CREDIT_ANALYSIS;
Fyi, the column contains values like 'no revenue', 'two', 'revenue22', '5.5'
Getting error:
Conversion failed when converting the varchar value '5.5' to data type int.