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

Home -> Community -> Usenet -> c.d.o.server -> Re: Problems combining a date and a character time field

Re: Problems combining a date and a character time field

From: Dadd <Dadd_at_cp.com>
Date: 2000/04/05
Message-ID: <8kwG4.19944$m5.305823@news1.rdc2.on.home.com>#1/1

Barry,
You can try this:
Insert into (MyDate,...) Values (
TO_DATE( TO_CHAR(date_field,'YYYYMMDD')||' '||time_fld,'YYYYMMDD HH:MI:SS'), ...
)
Make sure that your time_fld is in HH:MI:SS format. For other formats please look in Oracle docs under TO_DATE or TO_CHAR

HTH
Thomas

"Barry" <barryw_at_gmisystems.com> wrote in message news:8cdtdg$392$1_at_nnrp1.deja.com...
> 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
>
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
Received on Wed Apr 05 2000 - 00:00:00 CDT

Original text of this message

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