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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to trunc date column to half an hour

Re: how to trunc date column to half an hour

From: Jason Heinrich <jheinrich_at_pcci.edu>
Date: Tue, 06 Mar 2007 13:44:58 -0600
Message-ID: <C21320DA.19EC5%jheinrich@pcci.edu>


Itıs been taking up to an hour for me to get list messages, so apologies if someone has already given you this answer.

SELECT CASE WHEN to_number(to_char(sysdate,'MI')) < 30 THEN trunc(sysdate,'HH') ELSE trunc(sysdate,'HH') + 30/(60*24) END as half_hour from dual;

You could also create a function with the same logic and use it like the trunc command.

On 3/6/07 12:16 PM, Derya Oktay wrote:

> Hi All,
> Is there a way of displaying date columns, truncated to half an hours.
>
> For example: select trunc(sysdate,'HH') from dual;
>
> Regards,
> Derya.
>
>
> FYI. We are usig this sort of functions in group by expressions.
>
> PS. Ghassan thank you for your answer regarding local/global index es in
> partitions.
>
>
>



Jason Heinrich
Oracle Database Administrator
Pensacola Christian College
(850) 478-8496 x2509
jheinrich_at_pcci.edu
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Mar 06 2007 - 13:44:58 CST

Original text of this message

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