Re: Trunc(date)

From: Ian C. Sellers <ian#dont~need~no~stinking~spam_at_mystical.net>
Date: 1997/06/20
Message-ID: <33AAF43F.90C0109A_at_mystical.net>#1/1


Tong Siew Pui wrote:

> In developer 2000 , Form 4.5 :-
> If I want to truncate a date field to store only the date but w/o the
> time (actually all truncated to 12:00), I would need to use a trigger
> /procedure and call the function trunc(date) to truncate the date
> since Format Mask does not allow you to put a function.
>
> Is there anyway that I could do a setting for once, so that all date
> fields will be able to be truncated and store only the date factor so
> that I could use "=" or "<" to make date comparison and need not worry
>
> about the time factor ???
>
> If not, I would need to use trigger for every date field.
>
> Thanks.

  Oracle always stores the time in the database -- it's the nature of the date datatype. It defaults to 12:00AM if no time is specified. If you insert the current date, you can use the built-in funcs TO_CHAR and TO_DATE to format it when you select sysdate from dual to eliminate the time part of the date.

Hope this is what you mean. If not, be a little more descriptive with the question.

-Ian

Oh, remove the anti-spam thing from my address if you reply by e-mail. It's just ian_at_... Received on Fri Jun 20 1997 - 00:00:00 CEST

Original text of this message