Tip #1046: Find days until retirement

A question from a reader at a financial services firm:

I need to know how many days until my client reaches 65 years old. How can I do this with minimal configuration?

This type of calculation can be done using standard calculated fields in Dynamics 365.

  1. First, you will need to have a field that stores when the contact was born. While CRM includes a standard birthdate field, it is a date only field, you cannot mix deterministic and non-deterministic dates in calculation formulas. Since we will be calculating the difference between today and the contact’s 65th birthday, we will need to store the date in a local date time. Create a new birthday field(new_birthday). Just remember to set the time in field values to be 10:59 so the birthday isn’t displayed incorrectly in different timezones.
  2. Create a calculated whole number field for days util 65th birthday. Use formula DiffInDays(now(), ADDYEARS(65,new_birthday)) to get the number of days until 65.

Got any tip suggestions or question which might result in good tips? Send them to jar@crmtipoftheday.com

Photo by Cristian Newman

Share on FacebookTweet about this on TwitterShare on Google+

5 thoughts on “Tip #1046: Find days until retirement

  1. Chadi says:

    we can create the field birthday timezone independent rather than adding the hours

  2. Chadi says:

    we can create the field birthday as timezone independent

  3. Leonardo Mizikami says:

    The calculated whole number field shoud be a duration type and the formula, use DiffInMinutes, the will CRM displays duration fields as days.

    • Hi Leonardo,

      great idea! Couple caveats:

      1. Duration format does not really like negative values so your formula would need to be adjusted to avoid those.
      2. After the form save, the duration format seems to completely ignore the fact that it’s calculated and does allow editing of the value. Reverts back after the submit but the experience could be confusing to some users

Leave a Reply

Your email address will not be published. Required fields are marked *