Re: Strange Query error- please explain

From: J-P. Menier <jpm_at_cnen.de.edf.fr>
Date: 1996/08/22
Message-ID: <321C7D8E.1AA7_at_cnen.de.edf.fr>#1/1


John Duska 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
>
> --
> ============================================================
> John M. Duska | Systems Analyst
> mailto:duska_at_srfs.pitt.edu | Information Resources
> http://www.pitt.edu/~pauj4m | University of Pittsburgh
> ============================================================

        Oracle uses DATE/TIME format, maybe your DATE record isn't exactly '21-aug-96 00:00' but '21-aug-96 00:01' for example ?

        When you use the '=' operator ORACLE translates '21-aug-96' as you query, '21-aug-96 00:00' which doesn't match using '=' but match with LIKE.

        I hope it'll help you !

                Bon courage ! Received on Thu Aug 22 1996 - 00:00:00 CEST

Original text of this message