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: data comparision in Oracle

Re: data comparision in Oracle

From: Anurag Varma <avdbi_at_hotmail.com>
Date: Mon, 11 Aug 2003 22:48:45 GMT
Message-ID: <h3VZa.13385$bY4.2466@news02.roc.ny>

"abjiang" <member35506_at_dbforums.com> wrote in message news:3226846.1060641241_at_dbforums.com...
>
> I need to compare a column whose format is like '2003-08-11 18:35:43.0'
> with the sysdate and select all the records whose date is one day ahead
> of the sysdate. My query is like this:
>
> select * from tableA where to_date(substr(errinfo$datetime, 1,
> 19),'dd-mm-yyyy hh24:mi:ss') - sysdate)<0
>
> I get an error when running this query:
>
> "The following error has occurred:
>
> ORA-01861: literal does not match format string"
>
> Can anyone tell me what is wrong with my query and how to compare the
> date with the sysdate? Thanks!
>
>
> Abby
>
> --
> Posted via http://dbforums.com

Re-read your question:
Concentrate on: " column whose format is like '2003-08-11 18:35:43.0' " and then look at the format you have supplied to to_date "'dd-mm-yyyy hh24:mi:ss"

Did you get it?

Anurag Received on Mon Aug 11 2003 - 17:48:45 CDT

Original text of this message

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