Rounding to the Nearest Minute : ROUND « Date Timestamp Functions « Oracle PL/SQL Tutorial






SQL> SELECT TO_CHAR(ROUND(TO_DATE('060299 01:00:35 AM',
  2            'MMDDYY HH:MI:SS AM'),
  3            'MI'), 'DD-MON-YY HH:MI:SS AM') "Rounded to nearest Minute"
  4       from DUAL;

Rounded to nearest Mi
---------------------
02-JUN-99 01:01:00 AM

SQL>
SQL>








13.15.ROUND
13.15.1.The ROUND Function
13.15.2.Datetime Formatting Parameters for ROUND(x[, unit])
13.15.3.ROUND(x[, unit]) : round x. By default, x is rounded to the beginning of the nearest day
13.15.4.Round date to day
13.15.5.Rounds May 25, 2005, to the first day in the nearest month
13.15.6.Rounding to the Nearest Minute
13.15.7.ROUND(date_in_1,'CC')
13.15.8.Round result from months_between