Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: ORA-01861 Literal Does Not Match Format String
There are like 400 different formattings of DUAL's sysdate. You need to use the function to_char to convert the pd_date into the format that you have quoted, ie '1999-04-13 22:18:05'
Sysdate will tell you it is stored as one thing, but output another. Try doing this query:
Select pd_date from my_table;
See what it outputs...I'm willing to bet it won't be the format that you talked about earlier.
Hope this helps,
Clint
"Brian E. Parker" <beparker_at_reply.in.the.group.plz> wrote in message
news:QXWH6.85$c4.10457617_at_ounews.ou.edu...
> Hello,
>
> I'm trying to query an Oracle database from ColdFusion using SQL. I can
do:
>
> select * from my_table;
>
> One of the fields is pd_date, which is of type date ( at least this is
what
> s-designer tells me the datatype of that field is ). If I look at what is
> stored in pd_date, it is in this format:
>
> yyyy-mm-dd hh:mm:ss (example: 1999-04-13 22:18:05 )
>
> But, I can't do a query using a where clause on the pd_date field without
> getting the following error:
>
> ORA-01861 Literal Does Not Match Format String
>
> I've tried everything I can think of. Single-quotes, double-quotes,
> changing the format around, not specifying the time fields, using /
instead
> of -, etc. No matter what I do, assuming it's a legal SQL statement, I
get
> that same error back.
>
> If you have any idea what the problem is, please let me know.
>
> This is an example of what I am trying:
>
> select * from my_table where pd_date < '1999-04-13 22:18:05';
>
> TIA,
> -BEP
>
>
Received on Wed May 02 2001 - 12:10:52 CDT
![]() |
![]() |