Use of Round() function.....Ceiling () function [message #307249] |
Tue, 18 March 2008 04:32  |
sandeep_shirsat
Messages: 3 Registered: September 2006 Location: NASIK
|
Junior Member |

|
|
Hi all
How can we use ceiling() function of MS Access in ORacle ?..
I have foloowing query...
Round(43,1)= 43
ROund(43,-1)=40
I want
Round(43,..)=45
round(46,..)=50
I want to round off the figure 43, 46 to the next precision only....
This is possible with ceiling function of MS Access like
ceiling(43,5)=45
ceiling(46,5)=50
Is there any function which would act like ceiling()?
Please give me a reply urgent.......its very urgent
regards
sandeep
|
|
|
|
|
Re: Use of Round() function.....Ceiling () function [message #307268 is a reply to message #307254] |
Tue, 18 March 2008 05:13   |
 |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Hi,
Oracle has no built-in function for that, but you can achieve the desired result by using basic math. You were on the right track with the CEIL function, but this function is somewhat different from the one you know from Access. You might want to have a look at the Oracle manuals (http://tahiti.oracle.com).
read the previous replyWITH yourtable AS
(
SELECT 40 the_val FROM dual UNION ALL
SELECT 41 the_val FROM dual UNION ALL
SELECT 42 the_val FROM dual UNION ALL
SELECT 43 the_val FROM dual UNION ALL
SELECT 44 the_val FROM dual UNION ALL
SELECT 45 the_val FROM dual UNION ALL
SELECT 46 the_val FROM dual UNION ALL
SELECT 47 the_val FROM dual UNION ALL
SELECT 48 the_val FROM dual UNION ALL
SELECT 49 the_val FROM dual UNION ALL
SELECT 50 the_val FROM dual
)
SELECT the_val
, the_val/5 diff_5
, ceil(the_val/5) ceil_diff_5
, ceil(the_val/5)*5 next_5_fold
FROM yourtable
/ But there are other ways.
MHE
[Updated on: Tue, 18 March 2008 05:18] Report message to a moderator
|
|
|
|
|