Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to calculate a license end date based on start date, cancellation date and period (month/year).

(0) ShareShare
ReportReport
Posted on by 5

How to calculate a license end date based on start date, cancellation date and period (month/year).

For instance:

- a clients’ starts a user license on January 5, 2019 (start date),

- the license period is set to a month (period),

- on October 12, 2019, the client has let us know that he wants to end the license (cancellation date),

- Since the period is set to a month, the first possible end date should be November 4, 2019 (license end date)

How can we calculate the license end date based on start date, cancellation date and period (month/year)?

  • Suggested answer
    Roma Gupta Profile Picture
    725 on at
    RE: How to calculate a license end date based on start date, cancellation date and period (month/year).

    Sorry Marcel. I don't think the exact solution is possible via config only.

  • Happymarcel Profile Picture
    5 on at
    RE: How to calculate a license end date based on start date, cancellation date and period (month/year).

    Hi Roma,

    Thanks for the reply. Since I'm not a developer, I was hoping to have this somehow arranged within the boundaries of Dynamics instead of coding. Do you have any idea if this is possible?

    Kind regards,

    Marcel

  • Suggested answer
    Roma Gupta Profile Picture
    725 on at
    RE: How to calculate a license end date based on start date, cancellation date and period (month/year).

    Hi Marcel

    So If I understand correctly, you are also calculating days for subscription periods if its not starting at 1st of the month.

    What I can think of is call a plugin as soon a cancelled date is entered. You would have to have simple calculations in place for months, days, leap year & get it done. That would be simplest.

    Here are some URLs:

    dotnetcodr.com/.../

    www.w3resource.com/.../csharp-datetime-exercise-55.php

    stackoverflow.com/.../difference-in-months-between-two-dates

    codereview.stackexchange.com/.../loop-months-between-a-time-span-yyyy-mm-and-yyyy-mm

    Hope this helps!

    Regards

    Roma

  • Happymarcel Profile Picture
    5 on at
    RE: How to calculate a license end date based on start date, cancellation date and period (month/year).

    Hi Roma,

    Thanks for the reply.

    Period is fixed (month). So if a client starts a license (subscription) on the 2nd of January, the first possible End Date would be the 1st of February (subscription start date + subscription period).

    In my previous example we've received the cancellation from the client on the 12th of October, which means that the earliest Subscription End Date is November 4 (Subscription Start Date (January 5) + Subscription Periods). I guess the easiest would be to calculate the number of months from the Subscription Start Date to the Subscription Cancellation Date and round this number up. With the number of months we can calculate the Subscription End Date from the Subscription Start Date. My main concern is how to calculate the Number of months and round these up.

    Hopefully this is clear now. If not, just let me know.

    Kind regards,

    Marcel

  • Suggested answer
    Roma Gupta Profile Picture
    725 on at
    RE: How to calculate a license end date based on start date, cancellation date and period (month/year).

    Hi HappyMarcel

    Please make me understand the cancellation date & period in your example.

    How come if a period is a month, end date would be November 4 & not November 12?

    Period is like a notice period which would be applicable post cancellation date?

    So end date = cancellation date + Period?

    Regards

    Roma

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 97

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans