Re: search by date range
Date: Sun, 14 Nov 1999 11:01:46 GMT
Message-ID: <80m4qp$26h$1_at_nnrp1.deja.com>
Henry,
[Quoted] [Quoted] Oracle does something slightly strage with date comparisons, it
[Quoted] includes the time component in the calculation when not forced not to
[Quoted] do this. Thus, by Oracle logic a record dated 01/01/1999 00:00:01
meets the > '01-NOV-1999' criterion. You need to either code either:
SELECT BLAH_DT
FROM BLAH
WHERE BLAH_DT >= TO_DATE('02-NOV-1999');
or
SELECT BLAH_DT
FROM BLAH
[Quoted] WHERE TRUNC(BLAH_DT) > TRUNC(TO_DATE('01-NOV-1999');
unless you can be absolutely certain that all records have 00:00:00
times components. TRUNC() eliminates the time component from the
comparison.
In article <80l272$c37$1_at_nnrp1.deja.com>,
henry_atwork_at_my-deja.com wrote:
> will the following command work to find entries that are entered after
> 11/01/1999? select BLAH, BLAH, BLAH where date > '01-NOV-1999';
>
> if not how i can fix it? thanks.
>
> -hc
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Sun Nov 14 1999 - 12:01:46 CET