Possible Duplicate:
Precision, Scale, Sum, Divide.. Truncation
I've got a question. I've programmed a function but I'm having some problems when I divide 2 numbers using convert. Here is an example:
Declare @A Numeric(18,6)
Declare @B Numeric(18,6)
Set @A = 1
Set @B = 130
If i do the following query the result is : 0.007692307692307692
Select Convert(Decimal(30,18),@A / @B)
But if I do this the result is: 0.007692300000000000
(losing decimals)
Select Convert(Decimal(30,18),Convert(Decimal(30,18),@A) / Convert(Decimal(30,18),@B))
Can someone please explain why I'm losing decimals if I'm using the same precision and scale?