Forum Discussion

ShawnPetrunak's avatar
ShawnPetrunak
Qrew Trainee
7 years ago

Need Help with Annual Date Formula

I am trying to create a formula that references a date of birth field (Date), and acts as a countdown until that date occurs again next. For instance, if someone has a Date of Birth of 06-09-1983, I want to know how many days until 06-09 occurs again.

1 Reply

  • MCFNeil's avatar
    MCFNeil
    Qrew Captain
    Make a formula duration field and use the following:


    var number Age=(Year(Today())-Year([DOB])-1)
    +If(Month(Today())>Month([DOB]),1,0)
    +If(Month(Today())=Month([DOB]) and Day(Today())>=Day([DOB]),1,0);

    var date Birthday=AdjustYear([DOB], $Age+1);

    $Birthday-Today()



    You are basically finding the age, finding the next birthday, and then finding the difference (duration) between the birthday and today.



    (Yes I'm getting old)