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: Search Date functions

Re: Search Date functions

From: Steve McDaniels <steve.mcdaniels_at_sierra.com>
Date: Mon, 25 Sep 2000 15:24:40 -0700
Message-ID: <8qojb7$m7s$1@spiney.sierra.com>

in your SQL:

select dob, name
from contacts
where to_date(dob) LIKE to_date(:tdob)
order by to_date(dob), name

LIKE is used with partial values
as in NAME like 'Smi%'
(the percent is a wildcard character)

to_date(....) does not produce partial values

consider:

select ...
from ...
where to_date(dob) between SOME_DATE and SOMEOTHER_DATE

"Liming Xu" <lmxu_at_glue.umd.edu> wrote in message news:39CF9DC4.3D67169B_at_glue.umd.edu...
> hi, i'm haveing a little trouble converting a string in the format of
> "MM-DD-YYYY" to the corresponding version of "date" type..
>
> I'm using Pro C...
>
> here is what I have in the program
>
> EXEC SQL declare curdob cursor for
> select dob,name from Contacts where
> todate(dob) like todate(:tdob) ORDER BY todate(dob),name;
> EXEC SQL open curdob;
> EXEC SQL fetch curdob into :cmatchdob,:cmatchname;
>
> Variable Descriptions:
> dob: date column name in the table
> name: name column in the table.
> :tdob: the string date I read from the input...
> :cmatchdob: a string to store date.....
>
> Thanks.
>
Received on Mon Sep 25 2000 - 17:24:40 CDT

Original text of this message

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