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

Home -> Community -> Usenet -> c.d.o.server -> Re: Comparing 2 dates

Re: Comparing 2 dates

From: Erika Grondzakova <Erika.Grondzakova_at_cern.ch>
Date: Fri, 28 Jan 2000 11:39:45 +0100
Message-ID: <389171F1.B5DA5AE1@cern.ch>


Hi,

As I understood, wouldn't be enough just format only string field?

SELECT field2-to_date(field1,'YYYYDDMM') FROM your_table;

where field2 is date field and field1 is a string field in the format as you have described.

HTH, Erika

Nicky Taylor wrote:
>
> I have a 8 character string field which represents a date in the format
> 'YYYYMMDD' and I have a date field. I am trying to subtract one from the
> other by doing a TO_DATE on both fields with the format 'YYYYMMDD'. i.e.
>
> TO_DATE(date1,'YYYYMMDD') - TO_DATE(date2,'YYYYMMDD'))
>
> I keep getting ORA errors complaining about the formatting.
>
> Any help appreciated.
>
> Nicky.
Received on Fri Jan 28 2000 - 04:39:45 CST

Original text of this message

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