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/27
Message-ID: <398030A7.836EE147@edcmail.cr.usgs.gov>#1/1

Jerra,

I can't say that I've used this tool before. But if it supports the SQL-92 standard, then you should be able to use the BETWEEN operator. Does your tool use ODBC to connect to the database. If so, then you should be able to use the BETWEEN operator. Give it a try and see if it works!!!!

HTH,
Brian

Jerra wrote:
>
> Yes that is possible to some extent, but we are using RW dbtools (C++) and I am
> not sure wheter they support that.
>
> Thanks for the reply!
>
> /Jerra
>
> Brian Peasland wrote:
>
> > 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!
> > ========================================
 

-- 
========================================
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 Thu Jul 27 2000 - 00:00:00 CDT

Original text of this message

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