Need formula that can calculate age client was on specific date?

  • 1
  • 1
  • Question
  • Updated 3 years ago
  • Answered

Need to create formula that can calculate the age client was on a specific date. The date of birth is on a separate, but related, table. i.e. the client's birthday is Jan 1 1970, so he is 46 today. However, he took out the policy on Jan 15 2010, so he would have been 40. I need it to calculate the 40 years old. any help?

Photo of Lynn

Lynn

  • 0 Points

Posted 3 years ago

  • 1
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,664 Points 50k badge 2x thumb
Try this.  Put the values of your two fields for date of birth and the policy date into the formula variables.


var date DOB = [DOB];
var date PolicyDate = [Policy Date];

Year($PolicyDate) - Year($DOB)
-
If(
Month($PolicyDate) < Month($DOB)
or
(Month($PolicyDate) = Month($DOB) and Day($PolicyDate) < Day($DOB)),1,0)
Photo of Lynn

Lynn

  • 0 Points
This was exactly what I needed. Thanks!