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: how to delete leading zero from date

Re: how to delete leading zero from date

From: Markus Stuhlpfarrer <mstuhlpfarrer_at_hollomey.com>
Date: Tue, 26 Jun 2001 07:03:37 GMT
Message-ID: <3B384F85.6784005C@hollomey.com>

read the documentation about instr, substr and decode instr(datestring,'0') schould be 1 in 06/25/2001 if it is 1 make substr(datestring,2) which should remove the first character
so it is:
decode (instr(datestring,'0'),1,substr(datestring,2) ,datestring)

the last one is the else clause which returns the datestring unchanged

but there are many ways to make such a thing. maybe there is even an oracle internal function for such a thing too

rmartes wrote:

> I want to delete leading zero from date after converting into to_char
> format. etc. 06/25/2001 to 6/25/2001.
>
> thanks
  Received on Tue Jun 26 2001 - 02:03:37 CDT

Original text of this message

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