Re: [?] Period calculation..

From: Donna Kray <kray.donna_at_mlink.motors.ge.com>
Date: 1996/05/02
Message-ID: <4mad39$p6q_at_crissy.ge.com>#1/1


stmcdc_at_bora.dacom.co.kr (Jong Soo Lee) wrote:
>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
>:
>



I'm afraid I don't completely understand what you want.

sysdate - dateColumn yeilds the number of days between sysdate and dateColumn. If you do a to_date on that value, that would be meaningless. If you need to indicate the period, use the values sysdate and dateColumn themselves.

Write if you can help me understand what you need

Donna Received on Thu May 02 1996 - 00:00:00 CEST

Original text of this message