Home » SQL & PL/SQL » SQL & PL/SQL » VERY URGENT: HOW CAN I ROUND A NUMERIC VALUE UP TO THE HUNDREDS.
VERY URGENT: HOW CAN I ROUND A NUMERIC VALUE UP TO THE HUNDREDS. [message #19789] Wed, 10 April 2002 03:28 Go to next message
Alberto
Messages: 4
Registered: April 2002
Junior Member
VERY URGENT: HOW CAN I ROUND A NUMERIC VALUE UP TO THE HUNDREDS.
FOR EXAMPLE I HAVE TO ROUND 3711 TO 3800 AND 3211 TO 3800. THANKSS
Re: VERY URGENT: HOW CAN I ROUND A NUMERIC VALUE UP TO THE HUNDREDS. [message #19792 is a reply to message #19789] Wed, 10 April 2002 04:26 Go to previous messageGo to next message
Raj
Messages: 411
Registered: November 1998
Senior Member
Hi,
Try this out. I don't have Oracle on my machine. Below is for SQL Server, u can replace CASE with DECODE.

select CASE 3711 % 100 WHEN 0 THEN 100
ELSE 3711 - (3711 % 100) + 100 END

Cheers..
Raj
Re: VERY URGENT: HOW CAN I ROUND A NUMERIC VALUE UP TO THE HUNDREDS. [message #19822 is a reply to message #19789] Thu, 11 April 2002 05:16 Go to previous message
John R
Messages: 156
Registered: March 2000
Senior Member
Try

SELECT TRUNC(your_number+99,-2) FROM DUAL;
Previous Topic: Database procedure
Next Topic: "illegal variable name/number" error when one more OUT param along with a ref cursor
Goto Forum:
  


Current Time: Wed Apr 17 23:07:24 CDT 2024