Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: how to trunc date column to half an hour
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.
>
>
>
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Mar 06 2007 - 13:44:58 CST
![]() |
![]() |