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

Home -> Community -> Usenet -> c.d.o.misc -> Re: trunc

Re: trunc

From: Thomas Huewelmeier <thomas.huewelmeier_at_dresdner-bank.com>
Date: Wed, 12 May 1999 16:43:19 GMT
Message-ID: <7hcb36$cnb$1@nnrp1.deja.com>


Hi,

in my example
select to_char(trunc(sysdate),'HH:MM:SS') from dual (german language setting where date is dd.mm.yy)
i get 12:05:00

why ? because trunc(sysdate) delivers 12.05.99 and the to_char tries to convert 99 into seconds which is not possible

perhaps with your language settings the year is between days and months so you will get 12:00:05 or 05:00:12

with your statement you will hardly get '00:00:00'

Hope this helps

T. Huewelmeier

In article <373972BE.CB63D362_at_india.hp.com>,   "G.H VITTAL" <vittal_at_india.hp.com> wrote:
> Whenever we do date comparison I remember using trunc
> command
> if i say
>
> select to_char(trunc(date_field),'HH:MM:SS') from table1
>
> I see only second portion is truncated. But i want to truncate the
> entire time portion i mean i should expect 00:00:00 as the result. How
> do i do this ?
>
> regards
> vittal
>
>

--== Sent via Deja.com http://www.deja.com/ ==-- ---Share what you know. Learn what you don't.--- Received on Wed May 12 1999 - 11:43:19 CDT

Original text of this message

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