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: Data Conversion Problem

Re: Data Conversion Problem

From: Jurij Modic <jurij.modic_at_mf.sigov.mail.si>
Date: 1997/01/06
Message-ID: <32D0C5FF.60D4@mf.sigov.mail.si>#1/1

Andy Smith wrote:
>
> --
> I have a table TAB1, with one column COL1, datatype NUMBER
> select COL1 from TAB1;
> COL1
> ----------
> 5373484
> 1 rows selected.
>
> How do I convert 5373484 to HH24, assuming 5373484 is the number
> of days ??

Number of days since when?

If you have a start date, and want to do date arithmetic, combining start date and number of days in your table, you use ordinary ORACLE date arithmetics operators/functions. Note that basic unit for date arithmetic is 1 day.

For example, if you want to find date and time, 5373484 days before this moment, you isue next query:

        SELECT TO_CHAR(SYSDATE-tab1.col1,'DD-MON-YY HH24:MI') FROM tab1;

Jure

-- 
 ===============================================================
 ! Jurij Modic                            Republic of Slovenia !
 !  tel: +386 61 178 55 14                Ministry of Finance  !
 !  fax: +386 61  21 45 84                Zupanciceva 3        !
 !  e-mail: jurij.modic_at_mf.sigov.mail.si  Ljubljana 1000       !
 ===============================================================
Received on Mon Jan 06 1997 - 00:00:00 CST

Original text of this message

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