At 17:24 -0500 2/16/03, Melih Onvural wrote:
Hi all
i'm new to the SQL programming language and i was trying to play
with a date/time counter of sorts. I was trying to teach myself the
various date functions, but I feel like I've failed. I had a
database with birthdates in it, and I subtracted that from date in
the Year() function and then subtracted 1900. Someone told me this
was really sloppy so I was wondering what's a better method to find
someone's age?
Here's what I did
Year(Date - BirthDate) - 1900
(birthdate is the name of the field in the table)
Why not just look in the MySQL Reference Manual? It has the formula
for computing ages. The link to the manual appears at the bottom of
every message to this list. Go there, type "age calculations" into
the search box, and it'll show you this link:
http://www.mysql.com/doc/en/Date_calculations.html
thanks,
melih
---------------------------------------------------------------------
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