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 get decimal to date form

Re: How to get decimal to date form

From: Richard Foote <richard.foote_at_bigpond.com>
Date: Wed, 17 Sep 2003 12:58:07 GMT
Message-ID: <zTY9b.108303$bo1.1769@news-server.bigpond.net.au>


"wireless" <wireless200_at_yahoo.com> wrote in message news:90446ee7.0309170437.ed56658_at_posting.google.com...
> In our database is a decimal field with format YMMDDhhmmss.9999999999
> where the 9s are random digits. I'm trying to strip off just the
> YMMDD and put it in date form.
>
> So far I came up with:
> SUBSTR(TO_CHAR(rec_num,99999999999),1,6) AS Date which returns YMMDD.
>
> For example where the rec_num is 30608124143.47069519725 the above
> functions return 30608.
>
> I tried wrapping another TO_CHAR around it to try to format it to a
> date but this seems like it's a bit much for this purpose.
>
> Any suggestions would be appreciated.
>

Hi David,

I "think" this is what you're after:

SQL> select to_date(trunc(30608124143.47069519725), 'ymmddhh24miss') from dual;

TO_DATE(T



08/JUN/03 Cheers

Richard Received on Wed Sep 17 2003 - 07:58:07 CDT

Original text of this message

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