Home » Developer & Programmer » Reports & Discoverer » Round Function
Round Function [message #90098] Wed, 27 October 2004 10:58 Go to next message
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
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
Previous Topic: How to Group
Next Topic: how ?
Goto Forum:
  


Current Time: Sun May 05 14:29:17 CDT 2024