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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Add +1 to the DateDiff result formula

(0) ShareShare
ReportReport
Posted on by 905

Hello,

I have two date fields start and end date in a form. I would like to calculate the difference between those dates which can be achieved using the below formula:

DIFFINDAYS(cr1b0_startdate, cr1b0_enddate)

Example: Start Date: 5/11/2022 - End Date: 5/23/2022
Total: 12 Days

According to the above formula, the result is 12 days, however, in our requirements, we need to add and wrap the formula with a +1 as a result because the real total should be 13 days.
aDDdAYFormula.png

What should be the updated formula to add +1 to DIFFINDAYS(cr1b0_startdate, cr1b0_enddate)?

Could you please provide an example to achieve the above requirements?

Any help is highly appreciated.

Best regards,
EBMRay

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at

    Hi EBMRay,

    DIFFINDAYS() need two date and time value as parameter and return type is whole number. ADDDAYS() first parameter is whole number type, second is date and time type and return type is date and time.

    The reason you get this error is because you pass two whole number as parameter to ADDDAYS(). So you can first add 1 day to end date and then use DIFFINDAYS().

    Please try this expression:

    DiffInDays(cr884_startdate, AddDays(1, cr884_enddate))

    Test:

    pastedimage1653370820184v1.png

    Result:

    pastedimage1653370844298v2.png

  • EBMRay Profile Picture
    905 on at

    Hi ,

    Thank you so much for providing the above example, it worked perfectly.

    Will it be possible to exclude weekends and public holidays through the calculated fields or this is something that should be done in JS?

    Awaiting your response.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi EBMRay,

    Calculated field can't do this. You should use JS.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 55

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans