IF you insert into a table using the to_date function, Oracle uses that
function to make the calculation and converts it to a number. So, if you
used the function to_date('01-01-2002', 'dd-mm-yyyy') this would be the same
as to_date('Jan 01, 2002', 'Mon dd, yyyy'). If you start adding times in to
get more complicated, but you get the idea.
-Bruce
-----Original Message-----
From: Kipp, James [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 25, 2002 12:10 PM
To: Powell, Bruce; DBI-Users
Subject: RE: Inserting formatted Date
>
> Oracle stores the date as a number. This works out as the
> number of seconds
> from a significant date (in Oracle's mind). Therefore, you
> must send it as
> a date (or number). The to_char function returns the character
> representation of the number stored in the field.
so then it does not matter how i format it before when i insert it? what i
mean if i insert a date that is formatted to "25-Jun-2002 13:44"(no seconds)
and this is entered into a date field in 2 seperate tables a second apart
(but still both display "25-Jun-2002 13:44" if queried) the 2 will still not
be equal?
>
> -----Original Message-----
> From: Kipp, James [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 25, 2002 11:20 AM
> To: DBI-Users
> Subject: RE: Inserting formatted Date
>
>
> >
> > What is the data type for the field into which you are
> > inserting the date?
> > If it's a DATE field, you do the formatting when you retrieve
> > the value,
> > not when you set it. If it's not a DATE field, it should be.
>
> the data type is 'date'. I wanted to format it as i insert
> because the field
> is a key on 2 tables i will be querying on (so the date/time
> should be =)? i
> guess the question would then be "how does oracle store the
> date" ? meaning
> if it is formatted then stored, does oracle still store it
> like "6/25/2002
> 1:18:14 PM" anyway.
>
___________________________________________________________________________
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is
for the sole use of the intended recipient(s) and may contain confidential
and privileged information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the intended recipient, please
contact the sender by reply e-mail and destroy all copies of the original
message.