Page 1 of 1

summary report with a lot of decimal places

Posted: Sat Nov 03, 2007 9:57 am
by patelwork
hi,

i have build a detail report with some amounts, the amounts have a lot of decimal places . eg

fld1 fld2
---- ------------------
a1 258.3698745112547
a2 123.369258171254
a3 32145.2314587923
b1 25987.2
b2 12457.5
b3 1144.59

and so on...

at last the summ of these amount is showing...
its ok...

now i build another report with the same data but its a summary report

select fld1, sum(decode(substr(fld1,1,1),'a',fld2,0) - sum(decode(substr(fld1,1,1),'b',fld2,0)
from mytable.
group by fld1

the summ of amount of the above fileds are not match to the details report..

i think some thing is wrong with a lot of decimal
i have tried a ... round function in diff places but the results is still same

please help me out.

thanks

Posted: Mon Nov 05, 2007 5:29 am
by ahmadbilal
use Round function in both reports it Returns the left number rounded to right number places of the decimal point

for example
select ROUND(1.57) from dual;

ROUND(1.57)
-----------
2

Or use TRUNCATE function