Numeric(precision,decimal) equivalent in ssrs

Viewed 73

I have a sql statement :

Declare @res numeric(30,10)
Declare @num1 numeric(30,10) = 233.6108200000
Declare @num2 numeric(30,10) = 200000.0000000000
Declare @num3 numeric(30,10) = 0.8341
set @res = ((@num1/@num2) * 10000 * @num3)
select @res

o/p : 9.7427050000

But in ssrs expression if I try to convert :

=CDec((233.6108200000/200000.0000000000) * 10000 * 0.8341)

o/p : 9.74273925

Edit What changes I need to make to ssrs expression/textbox properties to match with sql server results?

1 Answers

I'm not in a position to test this. But I suspect that in this expression

=CDec((233.6108200000/200000.0000000000) * 10000 * 0.8341)

some or all the numbers are interpreted as floating point numbers, which results in floating-point arithmetic. I suspect you need something more along the lines of this expression to force decimal (numeric) arithmetic.

= (CDec(233.6108200000)/CDec(200000.0000000000)) * CDec(10000) * CDec(0.8341)
Related