Forum Discussion

MikeMcCartney's avatar
MikeMcCartney
Qrew Member
5 years ago

Age today

I for the life of me can't figure out the formula to calculate today's age based on a simple date field called DOB. Help!

------------------------------
Mike McCartney
------------------------------
  • Mike,

    The simplest answer is a  Formula Duration field

    Today()-[DOB]

    However, you need very young people because it will display their age in Days when you have smart units set.

    What are you using the information for?  Do you need it in another calculation?  If so then this is fine.

    If you are going to show it to a User to make a decision on then change to a Formula Rich Text
    This will show whole years.

    var number Age =ToDays(Today()-[DOB]);
    var number AgeYears = Round(($Age)/365);
    ToText($AgeYears)

    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend
      This numeric formula field will give you the exact age in integer years. 



      var date DOB = [DOB];

      Year(Today())-Year($DOB)
      -
      If(
      Month(Today())<Month($DOB)
      or
      (Month(Today())=Month($DOB) and Day(Today())<Day($DOB)),1,0)


      ------------------------------
      Mark Shnier (YQC)
      Quick Base Solution Provider
      Your Quick Base Coach
      http://QuickBaseCoach.com
      mark.shnier@gmail.com
      ------------------------------
  • Thanks. Worked well.

    ------------------------------
    Mike McCartney
    ------------------------------