Hi,
I would like to display 2 dates differences into month and days, e.g. 2 month 15 days. It seem standard calculated field is unable to achieve this, as the diffindays is calculate the total day in difference between the 2 dates.
In excel, we can use DATEDIF(A1,B1,"M") & "month ," &DATEDIF(A1,B1,"MD") & "days" it would return the desire result. How to achieve this ?
Thanks.
Regards,
Teh
I guess there's no oob function to achieve this. But you can write your own plugin.
1. Register the plugin on record creation and update.
2. Retrieve these 2 datetime attributes in plugin.
3. Define 2 DateTime variable in the plugin, set datetime equals to attributes datetime.
4. Compare month, days difference referring below document.
docs.microsoft.com/.../system.datetime.month
5. Pass the comparing difference back to CRM.
But there's one issue with displaying 2 dates differences into month and days. For example: date1 is Jan 15th, date2 is March 3. If we compare date difference into month and days, it will be come 2 month -12 days.
If you don't want negative number, then you need to make assumption, say every month is 30 days.
André Arnaud de Cal...
291,979
Super User 2025 Season 1
Martin Dráb
230,848
Most Valuable Professional
nmaenpaa
101,156