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 Chriss Miller 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
Joined
May 4, 2001
Messages
1,284
Location
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