0 Replies Latest reply on May 10, 2010 6:06 AM by deansy55

    Calculate age at insert

    Level 1

      Hi,

       

      I got a script from the net to display the age of someone on my detailed page of the client:

       

      DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(App1DOB, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(App1DOB, '00-%m-%d')) AS App1Age, DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(App2DOB, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(App2DOB, '00-%m-%d')) AS App2Age

       

      However i cannot search/filter an AS for some reason, how could i modify this to auto insert the age based on the users date of birth they input on my insert form?

       

      hope someone can help.