Re: [?] Period calculation..

From: Yoram zilberberg <elric_dm_at_netvision.net.il>
Date: 1996/04/28
Message-ID: <NEWTNews.830749832.17874.elric_dm_at_dialup.netvision.net.il>#1/1


Date minus date is a number,
you should use a function to calc the "date" difference (you realy want the number of days shown as the number of years, months and days, right ?)

look at a date function called month_between (i think) dividing that result by 12 will give you the years and the days a easy after that.

good luck,

In Article<4lsvsd$qr8_at_nis.dacom.co.kr>, <stmcdc_at_bora.dacom.co.kr> write:
> Path:

news.NetVision.net.il!psinntp!psinntp!psinntp!howland.reston.ans.net!newsfeed.i

nternetmci.com!news.dacom.co.kr!bora!stmcdc

> From: stmcdc_at_bora.dacom.co.kr (Jong Soo Lee)
> Newsgroups: comp.databases.oracle
> Subject: [?] Period calculation..
> Date: 27 Apr 1996 11:19:41 GMT
> Organization: DACOM Internet
> Lines: 38
> Message-ID: <4lsvsd$qr8_at_nis.dacom.co.kr>
> NNTP-Posting-Host: bora.dacom.co.kr
> X-Newsreader: TIN [version 1.2 PL2]
>
> Hi~ there,
>
> I've posted this one sometime ago.
> However nobody answered me. And I am still waiting for any advise.
>
> TIA,
>
> Tristan
>
>
> Hi~ there,
>
> Want to calculate period as follows;
>
> select sysdate - dateColumn from emp;
>
> All I wanna do is 'yy/mm/dd' formatted period.
>
> select sysdate + number from emp; or
> select (sysdate + 30) newdate from emp; works.
>
> But select trunc(sysdate - dateColumn) newdate from emp;
> returns around 2800 when dateColumn is 01-JAN-1989.
>
> How can I convert 2800 to dated in forms of 'yyyy/mm/dd'?
> or select to_date((sysdate - dateColumn), 'yyyy/mm/dd') newdate from emp;
>
> Any comment wil be highly appreciated.
>
> TIA form your help.
>
> Best regards,
>
> Tristan.
>
> PS: pls mail me to stmljsr_at_xmail.lgeds.co.kr
> :
>
Received on Sun Apr 28 1996 - 00:00:00 CEST

Original text of this message