Posted By

erraja_07 on 03/23/11


Tagged


Versions (?)

MYSQL query to calculate Date of Birth


 / Published in: MySQL
 

URL: http://ma.tt/2003/12/calculate-age-in-mysql/

  1. SELECT DATE_FORMAT( FROM_DAYS( TO_DAYS( NOW( ) ) - TO_DAYS( dob ) ) , '%Y' ) +0 AS age
  2. FROM table_name
  3. WHERE `usersid` =14
  4. LIMIT 0 , 30

Report this snippet  

You need to login to post a comment.