I have 2 numeric type variable. I want to devide this variables. But I want result is Numeric(5,2).
For example:
DECLARE @DISCOUNT_PRICE numeric(9,2) = '436.63'
DECLARE @PRICE numeric(9,2) = '1.2'
SELECT CAST((((@DISCOUNT_PRICE*100)/@PRICE) -100 ) AS NUMERIC(5,2))
Variables (9,2) I want result as (5,2)
When I ran this code, I get an error:
Arithmetic overflow error converting numeric to data type numeric
Thanks for the help.