Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Round of the minutes to the nearest value , if has decimals

SureshKumar.GJan 3 2020 — edited Jan 3 2020

Hi,

I have a requirement to populate the hours as shown in the below example.

1. If the Hour is 8.13 , which has decimal ( 8h.13mi), I need to show as 8.15  => Minutes if < 15 then minutes should be rounded as 15

2. If the hour is 8.23 , then I need to show 8.30        => Minutes < 30 then minutes should be rounded as 30

3. If the hour is 8.38 then I need to show 8.45          => Minutes < 45 then minutes should be rounded as 45

4. If the hour is 8:47 then I need to show 9h.           => Minutes < 60 then minutes should be rounded as round the Hour as ( 9 hour )

Please suggest me the logic to populate the values accordingly , from the table, that might populate more records.

I need to achieve this using SQL statement.

thanks

This post has been answered by Solomon Yakobson on Jan 3 2020
Jump to Answer
Comments
Post Details
Added on Jan 3 2020
9 comments
925 views