Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Birthdate to Age

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Here is a way to find out the age of someone from his birthdate stored in a date field called "birthdate" (YYYY-MM-DD) :

SELECT FLOOR(PERIOD_DIFF(LEFT(CURDATE()+0, 6),LEFT(REPLACE(birthdate, '-', ''), 6)) / 12) AS age FROM ... etc...

That's all!

-----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top