Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: date column in where clause -> suppressing index?
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/200023:59','MM/DD/YYYY HH24:MI'); HTH,
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
![]() |
![]() |