Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Convert date into timestamp before runnin the a query
leoh wrote:
> Hello,
>
> ==> I have to run the following query
>
> ---------------
> select * from tec_t_evt_rep where (date_reception> $begin and
> date_reception< $end) or (last_modified_time > $begin and
> last_modified_time < $end)
> ----------------
>
> $begin => first timestamp
> $end => last timestamp
>
> ==> The problem is, last_modified_time is VARCHAR in the date format
> dd/mm/yy
>
> Is it possible to create a query where last_modified_time is converted
> to timestamp before the query execution? Somenting like :
>
> select (...) or (convert_timestamp(last_modified_time,'dd/mm/yy')
> and ...)
It would be better to fix the bad design. But have you looked at
TO_TIMESTAMP?
www.psoug.org
Click on Morgan's Library
Click on Built-in Functions at the top of the page
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Wed Apr 25 2007 - 22:54:56 CDT