Re: Strange Query error- please explain

From: Ted Goulden <gouldent_at_cadvision.com>
Date: 1996/08/30
Message-ID: <505n6u$4k22_at_elmo.cadvision.com>#1/1


james.cen_at_lex.mts.dec.com (James Cen) wrote:

The reason is that ORACLE stores the time (# of seconds since 0000) in date fields by default. Unless your have a record that was created at midnight you will not get a match. Use "where trunc(trandate) = to_date ('21-aug-96')" and you should not have a problem; trunc strips off the time portion of the date field.

>> 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 Fri Aug 30 1996 - 00:00:00 CEST

Original text of this message