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: to_date format

Re: to_date format

From: Peter Kallweit <p_kallweit_at_arcor.de>
Date: Tue, 19 Sep 2006 14:55:52 +0200
Message-ID: <450fe8db$0$26959$9b4e6d93@newsspool4.arcor-online.net>


MattJ83 wrote:

>> Hi Matt,
>>
>> if your filename consists always of the date followed by an underscore
>> followed by something else, then you can just take the substring up to
>> the first unterscore:
>> TO_DATE(SUBSTR('$filename',1,INSTR('$filename','_')-1),'YYYYMMDDHH24')
>>
>>
>> hth
>> Peter

>
>
> Thats great thanks Peter.
>
> So that works - is there a way as easy as that for grabbing the 103
> part - or is it best to split the filename up to get this?
>

Just continue as with the first part - now we take everything between the first and the second underscore:
substr('$filename',instr('$filename,'_')+1,instr('$filename','_',1,2)-1)

hth
Peter Received on Tue Sep 19 2006 - 07:55:52 CDT

Original text of this message

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