|
The problem occurs because the calculation is performed under the cover as
float.
One rule when working with float is, if the (calculated) maximum length is
reached, decimal positions are cut at the end.
If you change the cast function to a precicion of 24 or , it calculates
correctly.
Select x.*,
(A - B) / B * 100.00 as RESULT
from (Values(cast(1.5267 as decimal(24, 4)), cast(1,6 as decimal(12, 4)))) x
(a, b);;
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.