At 5:18 AM -0500 7/24/99, Tnu Samuel wrote:
>Michael Farr wrote:
>
>> Hi, what is the easyest way to calculate someones age from their date of
>> birth? I have this, but is there something better?
>>
>> SELECT year(FROM_DAYS(TO_DAYS(NOW())-TO_DAYS(dOB))) FROM Person;
>
>Look at functions
>
>PERIOD_DIFF(P1,P2)
>DATE_ADD(date,INTERVAL expr type)
>DATE_SUB(date,INTERVAL expr type)
>ADDDATE(date,INTERVAL expr type)
>SUBDATE(date,INTERVAL expr type)
I don't understand this answer. The last four functions return dates;
how do they give you an age?
--
Paul DuBois, paul@stripped