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: Tim Witort <trw__at__medicalert.org>
Date: 1997/04/25
Message-ID: <3360DD54.64F@_medicalert.org>#1/1

Shaochun Lin 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,

I'm sure there will be a million followups to this but...

The results of a date subtraction are in days. So if you subtract one date from another, the result is the number of days between the two dates. The resulting day number is not an integer - it is the full difference between the dates including the time portion of the dates.

You CANNOT add two dates, so A+B and SUM(A) are illegal.

You CAN add *to* a date. For example, SYSDATE+3 will yield a date which is exactly 3 days from the current system date. Subtractions work the same.

Plus there are some date functions that do stuff like MONTHS_BETWEEN, etc.

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

Original text of this message

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