Error : Arithmetic overflow error converting numeric to data type varchar.
Getting error at this line why and what should be changed?
CONVERT(VARCHAR(8),CONVERT(DECIMAL(8,4),((CurrentLoans.Price - PreviousLoans.Price) / PreviousLoans.Price) * 100))
Here's at least one issue:
CONVERT(VARCHAR(8),CONVERT(DECIMAL(8,4))
The Decimal(8,4)
indicates 8 numeric digits, 4 to the right of the decimal. This does NOT account for the actual decimal character, so you potentially have a value like:
1234.5678
which is a valid Decimal(8,4)
but won't fit in a varchar(8)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With