While developing a Facebook Dating app recently, I needed to return records for a date range between minimum and maximum age from users table but the data was in the date format (birthday).
Following select command will calculate the age from the `birthday` column value for you for each record:
SELECT EXTRACT(YEAR FROM (FROM_DAYS(DATEDIFF(NOW(),`birthday`))))+0 AS age FROM `table`
And if you have to use it in the SELECT statement, then do it like this in yuor select command where `birthday` is the column name for date:
SELECT * FROM `table` WHERE EXTRACT(YEAR FROM (FROM_DAYS(DATEDIFF(NOW(),`birthday`))))+0 BETWEEN '18' AND '25'
Hope that helps.