I am trying to calculate an approximate age from a birth month field
(birthMonthVal TINYINT(3) UNSIGNED NOT NULL) and birth year field
(birthYearVal SMALLINT(4) UNSIGNED NOT NULL). I do not have the day so an
approximate age is OK (the results will be grouped in an aggregate format
anyway).

How do I...
A) bring these two fields together
B) assign a day value to calculate age, if needed
C) calculate the age

I was trying something like the following syntax but this doesn't combine
the fields or use a date format.
SELECT (TO_DAYS(NOW())-TO_DAYS(???)/365) FROM table;

Thank you.

Zach Curtis
POPULUS


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to