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 :
Customer experience | Sales, Customer Insights,...
Unanswered

Taking the last day of the month in Date and Time Field

(0) ShareShare
ReportReport
Posted on by 5

We have a Calculated Field with Data Type:Date and Time (let's call it Y) . The value is based on another Date and Time field (X) and it needs to be the last day of the next month. For example

X = 12.4.2021, i need Y=31.5.2021

Version 1612 (8.2.1.176) (DB 8.2.1.176) on-premises

Can we do that?

I have the same question (0)
  • Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    If calculated field creation is not mandatory then 

    I would suggest to use some other business logic like Plugin, Script etc.

    These approach will be easier one.

    Thanks,

    Pradeep.

  • Esteban Coto Alfaro Profile Picture
    on at

    Hello, I recommend you to do something like this in JavaScript, this does not require any library:

    var date = new Date();

    var lastday = new Date(date.getFullYear(), date.getMonth() + 1, 0); // the + 1 in the month refers to the actual month, if you want the last day of the next month you must put + 2.

    Thanks!

    Community Support Team - Esteban

    If this Post helps, then please consider Accept as solution to help the other members find it more quickly.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans