Hi,
I'm creating 2 date field and 1 decimal number field. The decimal number field is set to use calculated field.
In the formula, I set it as DiffInMonths(startdate, enddate). When start date as 1st May and end date as 1st June, the result is 1.0, but if the end date is set as 2nd June, the result is 2.0.
How is this DiffInMonths function work?
Thanks.
Regards,
Teh
Hi Rakesh,
Thanks. Will try log a case for this issue.
Regards,
Teh
YA TEH,
As stated in https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/customize/define-calculated-fields the behavior should be as defined.
DIFFINMONTHS (date and time, date and time) | Returns the difference in months between two Date and Time fields. If both dates and times fall on the same month, the difference is zero. | Whole Number |
I tested your scenario in my vanilla organization i.e. created two date field i.e. StartDate and EndDate. Further created third field "TimeTaken" (calculated Field) as a whole number field.
When I look for 1st May to 1st June it shows as 1
When I change to 2nd June, it shows as 2
When I select End date to be of same month, it should show as 0, however it shows as 1 which is not an expected behavior. As this is reproducible in vanilla org, I would suggest you to please raise a support ticket with Microsoft as this needs to be investigated by Support Reps.
If this is helpful, kindly mark this as a Suggested answer.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156