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 CRM (Archived)

Increment date by x months using AddMonths not calculating correctly

(0) ShareShare
ReportReport
Posted on by 7

Incrementing date field by months based on a user input field(#of months to increment)

1.LastScheduledDate(a simple date only field)

2. Increment field(whole number).

3. Calculated Field "NextDate" formula is: Set NextDate to AddMonths(Increment;LastScheduledDate)

4. I have a workflow that updates LastScheduledDate so the NextDate keeps getting created.

Here are the results:

Last Scheduled Date=8/1/2018..... Next Scheduled date gets properly calculated to 10/1/2018. The increment is 2(months).

Last Scheduled Date=10/1/2018... Next Scheduled date gets improperly calculated to 11/30/2018. Expected it to be 12/1/2018.

Then all the rest of the dates are now incorrect falling on the 30th instead of the 1st.

Does anyone know how to tweek this? I like that it rolls to the next year, but the day/month is incorrect.

Day cannot be higher than 28.

Any help appreciated!!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi Carol,

    I did the similar step for me I am getting expected result . Here is the result.

    CalculatedField.png

    Please match the all the field details with below screenshot  , hope you will get helps from here .

    Scheduled Date Field :

    ScheduledDate.png

    Whole Number :

    Whole-Number.png

    Calculated Date Field :

    CalculatedField.png

    Calculated Date Field conditions :

    CalculatedFieldCondition.png

  • Carol J Kelly Profile Picture
    7 on at

    Thanks. I changed the Behavior from User Local to Date Only on the calculated field as you have it and its working nicely. Missed that setting completely.. was heading to javascript!! LOL

  • gdas Profile Picture
    50,091 Moderator on at

    Great :)

  • Hasintha Nagodavithana Profile Picture
    145 on at

    Hi Carol,

    I have tested the same thing in my teasing environment which is D365.

    1. Added calculated field 'Closed By' to Case

    2. set calculation "AddMonths(2, resolveby)"

    3. publish the changes and set the resolved by date to 01/10/2018

    4. The Closed by date was calculated correctly. (01/12/2018)  

    2671.Untitled.png

    So I don't think there is an issue on the date field calculated field. Please check your calculation formula again. 

    Regards,

    Hasi

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans