Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Search Date functions
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
![]() |
![]() |