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: date data manipulation

Re: date data manipulation

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: 1997/04/25
Message-ID: <5jql3n$9pm@info.csufresno.edu>#1/1

In article <5jl5r2$nk$1_at_cronkite.seas.gwu.edu>, Shaochun Lin <lovedog_at_gwis2.circ.gwu.edu> wrote:
>I am a bit confused about how to caculate the date.
>Such as how old a person. How the date handle the
>addition and subtraction. Such as if you have
>column A (date type) and column B(date type). If you
>do A+B and A-B or even sum(A). Could someone enlighten
>me a little bit. Thank,SC Lin,

A+B and sum(A) don't make any sense. About the only useful date calculation is a difference, as in A-B. This gives the number of days between two dates. The result may include a fraction, if A or B contain different times of the day.

Try it for yourself in SQL Plus:

select to_date('19970430','yyyymmdd')-sysdate "Days" from dual;

     Days



 4.623044

Steve Cosner Received on Fri Apr 25 1997 - 00:00:00 CDT

Original text of this message

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