Subject | Re: [firebird-support] age calculation |
---|---|
Author | Daniel Rail |
Post date | 2006-10-21T02:04:03Z |
Hi,
At October 20, 2006, 10:47 PM, Fernando Salaices wrote:
expecting. Don't forget that there's a leap year every 4 years that
has 366 days.
--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Consultants Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
At October 20, 2006, 10:47 PM, Fernando Salaices wrote:
> I have a question about how to calculate the correct age of a personTry dividing by 365.25. And, you should see the result that you are
> using the date of birth. I'm trying something like this:
> select
> cast('10/20/2005' as date) AS CURRENTDATE
> ,(cast((current_date - cast('10/21/1974' as date)) as float)/365) as
> YEARS_OF_LIFE_OF_PERSON
> from rdb$database;
> In this query, I subtract from the current date (october 20, 2006 in
> this case) the DOB (october 21, 1974). It should give me a number just
> below 32, but I get 32.0191780821918
> I thought it was a rounding error, that is why I started casing to FLOAT.
> What am I doing wrong?
expecting. Don't forget that there's a leap year every 4 years that
has 366 days.
--
Best regards,
Daniel Rail
Senior Software Developer
ACCRA Consultants Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)