Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: data comparision in Oracle
"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
![]() |
![]() |