Discussions

Expand all | Collapse all

Age today

  • 1.  Age today

    Posted 07-31-2020 18:34
    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
    ------------------------------


  • 2.  RE: Age today

    Posted 07-31-2020 20:24
    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
    ------------------------------



  • 3.  RE: Age today

    Posted 07-31-2020 22:28
    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
    ------------------------------



  • 4.  RE: Age today

    Posted 08-01-2020 18:11
    Thanks. Worked well.

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