Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: how to delete leading zero from date
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