Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Rounding minutes of DATE type in PL/SQL

Re: Rounding minutes of DATE type in PL/SQL

From: Jurij Modic <jmodic_at_src.si>
Date: Fri, 12 Feb 1999 12:49:36 GMT
Message-ID: <36c420c2.2236273@news.siol.net>


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)



The above opinions are mine and do not represent any official standpoints of my employer Received on Fri Feb 12 1999 - 06:49:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US