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: Problems combining a date and a character time field

Re: Problems combining a date and a character time field

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: Wed, 05 Apr 2000 00:49:54 GMT
Message-ID: <8ce2jb$8rs$1@nnrp1.deja.com>


In article <8cdtc5$38p$1_at_nnrp1.deja.com>,   Barry <barryw_at_gmisystems.com> wrote:
> I'm having problems combining a Date field with a Time which is
> stored in a varchar2(10) field to make an integrated Date field.
> I've tried things like TO_CHAR(date_field,'DD-MMM-YYY') || Time_fld
> which looks alright in a 'SELECT' but refuses to INSERT INTO a Date
> field.
>
> I'd appreciate any suggestions.
>
> TIA
>
> Barry
>

what does the time field look like? The default date format is dd-mon- yy which doesn't have any format for a time -- therefore you need to supply one. Also mmm should be MON? and yyy should be YYYY?

If you time_fld looks like 13:03:23 for 1:03:23PM, then:

to_date( TO_CHAR(date_field,'DDMMYYYY') || Time_fld, 'ddmmyyyyhh24:mi:ss' )

might work for you.

> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--

Thomas Kyte                              tkyte_at_us.oracle.com
Oracle Service Industries
http://osi.oracle.com/~tkyte/index.html --
Opinions are mine and do not necessarily reflect those of Oracle Corp

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Apr 04 2000 - 19:49:54 CDT

Original text of this message

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