Re: date/time field and its index

From: Otto Slooten <oslooten_at_nl.oracle.com>
Date: 19 Sep 1994 15:21:20 GMT
Message-ID: <35ka9g$lb_at_nlsu110.nl.oracle.com>


mcitron_at_hsc.usc.edu (Mark Citron) writes:

>I have a field which I am storing the date and time.
 

>How do I select all rows with today's date (ie disregard time)?
 

>If I do a to_date to strip out the time I loose the use of the index
>on the field.
 

>Any suggestions would be welcome.

One way would be to use:

where *your_column* >= trunc(sysdate)
and *your_column* < trunc(sysdate+1)

This way the index is still used (no function used on db-column)



Views and opinions, if any, are my own. Received on Mon Sep 19 1994 - 17:21:20 CEST

Original text of this message