Icon View Thread

The following is the text of the current message along with any replies.
Messages 21 to 30 of 42 total
Thread Calculating Age
Mon, Mar 12 2007 5:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ole,

<< Sure, but the two types have different precision. A YEAR interval has one
field, the year fraction, while a YEAR TO MONTH interval has two fields, the
year fraction and the month fraction. The interval between two dates,
represented in months, can therefore be different values depending on the
interval qualifier. >>

<<  Which is not correct. The interval (date'2007-03-09' - date'1990-01-01')
year equals 204 months, while the interval (date'2007-03-09' -
date'1990-01-01') year to month equals 206 months. >>

Okay, I get what you're saying now.

<< What I meant was that the expression (CURRENT_DATE - DateOfBirth) YEAR
should return the number of years between the two dates as an interval, just
like your expression returns the number of years as an integer. Richard's
original Age column was an INTERVAL YEAR type, and the expression
(CURRENT_DATE - DateOfBirth) YEAR should therefore be an appropriate
assignment source for the column. >>

Correct, but it won't be accurate as an age (down to the day) was my point.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Mar 12 2007 6:23 PMPermanent Link

"Ole Willy Tuv"
Tim,

<< Correct, but it won't be accurate as an age (down to the day) was my
point. >>

It would be accurate down to the year, which is the precision Richard
defined his Age column with Smile

Ole Willy Tuv

Mon, Mar 12 2007 6:58 PMPermanent Link

"Ole Willy Tuv"
<< It would be accurate down to the year, which is the precision Richard
defined his Age column with Smile>>

If Richard wants the age in days, he could define the Age column as INTERVAL
DAY and the generated column expression as:

(CURRENT_DATE - DateOfBirth) DAY

Btw, the expression:

(date'2007-03-12' - date'1970-03-12') day

should return 13514 (I think) Smile

Ole Willy Tuv

Mon, Mar 12 2007 7:08 PMPermanent Link

"Ole Willy Tuv"
<< Btw, the expression:

(date'2007-03-12' - date'1970-03-12') day

should return 13514 (I think) Smile>>

Shit, the expression:

(date'2007-03-12' - date'1946-10-21') day

returns 22057 (:

Ole Willy Tuv

Mon, Mar 12 2007 9:33 PMPermanent Link

Steve Forbes

Team Elevate Team Elevate

Hi Ole,

You are 22057 days (or 22058 days downunder) wise then! Wink

--
Best regards

Stevo

"Ole Willy Tuv" <owtuv@online.no> wrote in message
news:46C37F71-8B33-4D6B-9A03-4211F381A948@news.elevatesoft.com...
> << Btw, the expression:
>
> (date'2007-03-12' - date'1970-03-12') day
>
> should return 13514 (I think) Smile>>
>
> Shit, the expression:
>
> (date'2007-03-12' - date'1946-10-21') day
>
> returns 22057 (:
>
> Ole Willy Tuv
>
>

Tue, Mar 13 2007 6:03 AMPermanent Link

"Ole Willy Tuv"
Hi Steve,

<< You are 22057 days (or 22058 days downunder) wise then! Wink>>

hm.. seems like a lot of days, and still accumulating Smile

Regards,
Ole

Tue, Mar 13 2007 6:26 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ole,

<< It would be accurate down to the year, which is the precision Richard
defined his Age column with Smile>>

Yes, he'll get exactly what he requested, that's for sure. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 13 2007 6:27 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Ole,

<< Shit, the expression:

(date'2007-03-12' - date'1946-10-21') day

returns 22057 (: >>

You keep that up, you'll lap me in no time. Smiley

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Mar 11 2008 10:02 PMPermanent Link

Richard Harding
>> For example, my birthdate is 2007-03-12, which when subtracted from the
current date as expressed in year-months, will give him 444 months, or 37
years.  However, I'm not yet quite 37 (Smiley, so the age will be wrong.  

Tim must be 39 today  - Happy Birthday !!!!!

Richard Harding

Wed, Mar 12 2008 3:30 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Richard

>>> For example, my birthdate is 2007-03-12, which when subtracted from the
>current date as expressed in year-months, will give him 444 months, or 37
>years. However, I'm not yet quite 37 (Smiley, so the age will be wrong.
>
>Tim must be 39 today - Happy Birthday !!!!!

Richard 2007 to 2008 means Tim's only ONE

I must say he's the best 1 year old programmer I've ever encountered Smiley

Roy Lambert
« Previous PagePage 3 of 5Next Page »
Jump to Page:  1 2 3 4 5
Image