Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

How to get first and last day of the month?

Posted on by

Hi all, 

How can I get dates, when I have month?

I have dte 22.02.2019 and I know, that this if February (mthOfYr(d)).

I need first day and last day of month 0 01.02.2019 and 28.02.2019, becouse I must compare this dates.

Or maybe other method to 'if my date exist in february'? :) 

*This post is locked for comments

  • Suggested answer
    faiz7049 Profile Picture
    faiz7049 1,879 on at
    RE: How to get first and last day of the month?

    Hi Andriej,

    Kindly check this link blogs.msdn.microsoft.com/.../using-dynamic-query-values-sysqueryrangeutil-in-dynamics-ax 

    and also link http://mybhat.blogspot.com/2011/09/dynamics-ax-batch-job-relative-day.html

  • Suggested answer
    nmaenpaa Profile Picture
    nmaenpaa 101,156 on at
    RE: How to get first and last day of the month?

    You can always get the first day of month by substracting the dayOfMth from your date.

    And you can use endMth function to get the last day of the month, from the date you provide.

  • Suggested answer
    Blue Wang Profile Picture
    Blue Wang on at

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans