web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Difference in Month

(0) ShareShare
ReportReport
Posted on by 1,235

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

I have the same question (0)
  • RakeshJ Profile Picture
    on at

    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

    pastedimage1589205099697v3.png

    When I change to 2nd June, it shows as 2 

    pastedimage1589205135057v5.png

    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.

    pastedimage1589205183058v6.png

    If this is helpful, kindly mark this as a Suggested answer.

  • Venedict Profile Picture
    1,235 on at

    Hi Rakesh,

    Thanks. Will try log a case for this issue.

    Regards,

    Teh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 45 Most Valuable Professional

#2
iampranjal Profile Picture

iampranjal 36

#3
Satyam Prakash Profile Picture

Satyam Prakash 31

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans