Re: Strange Query error- please explain

From: James Cen <james.cen_at_lex.mts.dec.com>
Date: 1996/08/29
Message-ID: <james.cen-2908962131470001_at_nqsrv108.nqo.dec.com>#1/1


Another possibility is that "aug" in '21-aug-96' is in lower case. The default date format could be in upper case, i.e., '21-AUG-96'.

It is a safe practice to use "WHERE trandate = TO_DATE('21-AUG-96','DD-MON-YY')" in your query. This way, your code is independent of the default date format in your database.

james.cen_at_lex.mts.dec.com

In article <4vkvtc$1o9_at_newsserv.caiw.nl>, lcornel_at_caiw.nl (L.Cornelese) wrote:

> John Duska <duska_at_srfs.pitt.edu> wrote:
>
> >When I query a row in a database using "where trandate = '21-aug-96'" I
> >get 'no rows' returned. But if I do the same query using "where trandate
> >like '21-aug-96'", I get 1 row returned! The one row is the correct
> >answer. What is causing this ananomly? This is Oracle 6.0, btw.
> >thanks,
> >John
>
Received on Thu Aug 29 1996 - 00:00:00 CEST

Original text of this message