I have a task to transform (to round) decimals (with 2 decimal digits) using an sql cursor with the following rules
If the second decimal digit is:
a)0,1,2 then I must turn it to 0.
b)3,4,5,6,7 then I must turn it to 5.
c)8,9 then I must turn it to 0 (and add 1 in the first decimal digit).
The operation contains lots of records and values that need to be transformed using these rules. I am using a Microsoft SQL Server database.
Can you suggest me a smart sql that it can materialize these rules?
Thanx in advance!