Round Function [message #90098] |
Wed, 27 October 2004 10:58 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Rick
Messages: 49 Registered: March 2000
|
Member |
|
|
Having one of those days here, How can I make ROUND take a negative number and round it to zero? Using 9i Discoverer.
Thanks
Rick
|
|
|
Re: Round Function [message #90109 is a reply to message #90098] |
Fri, 29 October 2004 04:55 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
I do not know about dicoverer but in a Sql query you may do it by using Decode & Sign functions.
E.g.
Select Decode((sign(col1),-1,0,round(col1)) from dual;
So if the value of col1 is say -20 then your query will retrun 0.
If it is 20.2 then your query will return 20.
HTH
Regards
Himanshu
|
|
|