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

Home -> Community -> Usenet -> c.d.o.tools -> Re: date column in where clause -> suppressing index?

Re: date column in where clause -> suppressing index?

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: 2000/07/26
Message-ID: <397EDE42.71A2F4AE@edcmail.cr.usgs.gov>#1/1

Jerra,

Why don't you use the BETWEEN operator? For example, to search a table for today's date:

SELECT * FROM table WHERE date_column BETWEEN TO_DATE('07/26/2000 00:00','MM/DD/YYYY HH24:MI')

                                          AND TO_DATE('07/26/2000
23:59','MM/DD/YYYY HH24:MI'); HTH,
Brian

Jerra wrote:
>
> When using date and time how do I search for specific dates most efficently?
> Using where trunc(date,'DD') = to_date('26-07-2000','MM-DD-YYYY') the index
> for the date column can't be used.
> The time portion is important and can't be 00:00:00 and there is a lot of
> searches for posts for a specific day.
>
> TIA!
>
> /Jerra
 

-- 
========================================
Brian Peasland
Raytheons Systems at
  USGS EROS Data Center
These opinions are my own and do not
necessarily reflect the opinions of my 
company!
========================================
Received on Wed Jul 26 2000 - 00:00:00 CDT

Original text of this message

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