Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Convert date into timestamp before runnin the a query

Re: Convert date into timestamp before runnin the a query

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 25 Apr 2007 20:54:56 -0700
Message-ID: <1177559695.361569@bubbleator.drizzle.com>


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.org
Received on Wed Apr 25 2007 - 22:54:56 CDT

Original text of this message

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