Skip to content Skip to sidebar Skip to footer

Sql Server : Conversion Error Numeric To Varchar Case

I have this query: CASE ClaimsFees.TBA WHEN 0 THEN CAST(IndemnityReserve AS NUMERIC(9,2)) ELSE 'TBA' END AS 'Reserve Indemnity' but I always get this error: Error conver

Solution 1:

The column can only have one type, and as 'TBA' can only be a string, you'll need to make the numeric a string too.

CASE ClaimsFees.TBA WHEN 0 
then cast(cast(IndemnityReserve as NUMERIC(9,2)) as varchar(12))
else 'TBA' 
end as 'Reserve Indemnity',

Post a Comment for "Sql Server : Conversion Error Numeric To Varchar Case"