web
You’re offline. This is a read only version of the page.
close
Skip to main content
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)
  • Venedict Profile Picture
    1,235 on at
    RE: Difference in Month

    Hi Rakesh,

    Thanks. Will try log a case for this issue.

    Regards,

    Teh

  • RakeshJ Profile Picture
    on at
    RE: Difference in Month

    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.

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…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

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

#1
DAnny3211 Profile Picture

DAnny3211 401

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 137 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 71 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans