Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Rounding minutes of DATE type in PL/SQL
On Fri, 12 Feb 1999 12:23:04 +0100, "Povodi Ohre a.s."
<OHRE_at_UNL.PVTNET.CZ> wrote:
>Dear Friends,
> does anybody know how
>to round DATE type to 10th of minutes
>in PL/SQL?
>
>Examples: 12:25:30 -> 12:30:00
> 14:04:59 -> 14:00:00
> 23:59:00 -> 00:00:00 of next day
>etc.
>
>Command ROUND(SYSDATE, 'MI') rounds
>only to minutes not to 10th of minutes.
One of the possible sollutions:
SELECT
TO_DATE(ROUND(TO_CHAR(your_date, 'SSSSS')/600)*600, 'SSSSS')
FROM dual;
>Please send me a short message to rnature1_at_hotmail.com
>
>Thank you in advance
>
> Robert
HTH,
Jurij Modic <jmodic_at_src.si>
Certified Oracle7 DBA (OCP)