divide drops remainder in DB2 SQL -


So I'm dividing an integer from decimal, and storing result in decimal column. However, it always leaves partial component (part after the decimal point), if I increase the result by 10 or 100, then I get a more accurate result, but dividing again again falls partly to the part.

The fields I have inserted are an exact 5, scale is 0 decimal and one was precision 5, scale 3 decimal.

I have also attempted to cast an integer in decimal and it does not matter, nor does it multiply by 1.0.

I try to get ideas out and move.

Thank you, Buzzy

was incorrectly casting. After using the correct format

  CAST (integer as DSIM (5,3))  

This has worked before I have the exact and scale Had left


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -