Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: testing date

Re: testing date

From: David <ds_at_netvigator.com>
Date: Tue, 4 Aug 1998 19:55:49 +0800
Message-ID: <6q6t9p$nkr$1@imsp009a.netvigator.com>


Sounds like a trunc() will help. For example

select * from table_a where trunc(col1, 'd') = trunc(sysdate, 'd');

Alternatively, a slightly better query is

select * from table_a where col1 >= tunc(sysdate, 'd') and col < trunc(sysdate, 'd') + 1;

The first one cannot make use of index on col1, so it is very inefficient for large table. The second query can make use of index on col1 (if the index exists).

Ed Lufker wrote in message <6q4sff$8f9$1_at_sloth.swcp.com>...
>Hi All:
>
>
>Does anyone have any pl/sql code that tests the date in a column and
>compares it to todays day.
>
>
>thanks in advance for any help
>
>eddie lufker
>
Received on Tue Aug 04 1998 - 06:55:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US