Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 21 to 30 of 42 total |
Calculating Age |
Mon, Mar 12 2007 5:50 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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 PM | Permanent 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 Ole Willy Tuv |
Mon, Mar 12 2007 6:58 PM | Permanent Link |
"Ole Willy Tuv" | << It would be accurate down to the year, which is the precision Richard
defined his Age column with >> 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) Ole Willy Tuv |
Mon, Mar 12 2007 7:08 PM | Permanent Link |
"Ole Willy Tuv" | << Btw, the expression:
(date'2007-03-12' - date'1970-03-12') day should return 13514 (I think) >> Shit, the expression: (date'2007-03-12' - date'1946-10-21') day returns 22057 (: Ole Willy Tuv |
Mon, Mar 12 2007 9:33 PM | Permanent Link |
Steve Forbes Team Elevate | Hi Ole,
You are 22057 days (or 22058 days downunder) wise then! -- 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) >> > > Shit, the expression: > > (date'2007-03-12' - date'1946-10-21') day > > returns 22057 (: > > Ole Willy Tuv > > |
Tue, Mar 13 2007 6:03 AM | Permanent Link |
"Ole Willy Tuv" | Hi Steve,
<< You are 22057 days (or 22058 days downunder) wise then! >> hm.. seems like a lot of days, and still accumulating Regards, Ole |
Tue, Mar 13 2007 6:26 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ole,
<< It would be accurate down to the year, which is the precision Richard defined his Age column with >> Yes, he'll get exactly what he requested, that's for sure. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Mar 13 2007 6:27 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. 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. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Mar 11 2008 10:02 PM | Permanent 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 (, so the age will be wrong. Tim must be 39 today - Happy Birthday !!!!! Richard Harding |
Wed, Mar 12 2008 3:30 AM | Permanent Link |
Roy Lambert NLH Associates 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 (, 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 Roy Lambert |
« Previous Page | Page 3 of 5 | Next Page » |
Jump to Page: 1 2 3 4 5 |
This web page was last updated on Thursday, May 23, 2024 at 07:54 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |