New Technologies

  • Java
  • Javascript
  • DTML
  • Dot Net
  • ASP .Net
  • C# .Net
  • PHP
Your Ad Here

Wednesday, February 4, 2009

Get Age Using Mysql Functions

Get Age Using Mysql Functions:

 

·         select (YEAR(CURRENT_DATE()) - YEAR('2004-05-05') -

(UNIX_TIMESTAMP(CURRENT_DATE())<UNIX_TIMESTAMP(CONCAT(YEAR(CURRENT_DATE()),

'-', MONTH('2004-01-02'), '-', DAYOFMONTH('2008-01-02'))))) AS `age`

 

·         SELECT YEAR(DATE_SUB(NOW(), INTERVAL TO_DAYS('2004-01-02') DAY)) AS age

No comments:

Your Ad Here