Hi!!
I must execute this decimal operation:
(column1 / (1 + (column2 / 100)))
column1 and column2 are decimal(16,2) with a few integer value exmple:
22,33
283
123,13
It doesn't work..why?? ..for example:
-- Yes
(300.00 / (1 + (column2 / 100)))
-- No :-(
(300/ (1 + (column2 / 100)))
and i return this:
"
SQL0419N
A decimal divide operation is not valid because the result would have a negative scale.
Explanation: A specified decimal division is not valid because it will result in a negative scale.
The formula used internally to calculate the scale of the result for decimal division is:
Scale of result = 31 - np + ns - ds where np is the precision of the numerator, ns is the scale of the numerator, and ds is the scale of the denominator.
User Response:
Examine and ensure the precision and scale of all columns that may participate in a decimal division. Note that an integer or small integer value may be converted to a decimal for this calculation.
sqlcode: -419 sqlstate: 42911
"
Thank you very much.
Fabio