Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Problems combining a date and a character time field
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.comOracle Service Industries
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Apr 04 2000 - 19:49:54 CDT