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: date format

Re: date format

From: Scott Mattes <ScottMattes_at_yahoo.com>
Date: Thu, 18 Oct 2001 01:41:24 GMT
Message-ID: <8rqz7.192$vK6.121023@news1.news.adelphia.net>


The date is stored as date.time, where the date part is the number of days from some anchor point (I forget that one) and the time is the fraction of a day to the second.

For your example I would do

select ins_date \
  from docs
where ins_date < to_date( '23-mar-2001', 'dd-mon-yyyy' );

"Steve ." <syarbrou_at_nospam.enteract.com> wrote in message news:flasstoucmp81lgno9tcvnrp6u4hamjoj8_at_4ax.com...
> I am trying to figure out what the format a date field is being stored
> in an Oracle 8.0.5 database. Problem is that depending on the
> NLS_DATE_FORMAT setting on the client, SQL*PLUS will return the format
> differently. So two questions:
>
> 1. Is there a way to tell the real format the data is being stored
> in.
>
> 2. what is the best way to run a query against an oracle date field
> and be assured of an accurate comparison, where say:
>
> select ins_date from docs
> where ins_date < '23-MAR-2001';
>
> Thanks.
>
> Steve
>
> newsgroup replies preferred. Remove nospam when replying thru email.
Received on Wed Oct 17 2001 - 20:41:24 CDT

Original text of this message

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