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

total number of days in a month

(0) ShareShare
ReportReport
Posted on by

how can i calculate the total number of days in a month

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Shah Keyur Profile Picture
    365 on at

    You can use DateStartMth and endMth to get start and end date of a month. Substract them to get number of days.

    There are few other methods available in Global class and in System functions please have a look.

  • Community Member Profile Picture
    on at

    could you please tell me how can i get the current date of the selected month

  • Community Member Profile Picture
    on at

    use today() method

  • Suggested answer
    Pravasti AK Profile Picture
    2,985 on at

    Hi

    Please refer the below link

    http://ax2012madhav.blogspot.in/2012/10/number-of-days-in-month.html

     

    Thanks,

    Kavitha

  • Community Member Profile Picture
    on at

    today() will give today's date i need to select the current date of selected month that can be 12 of july or 7 of may so, i want to select 12  or it can b 7

  • Community Member Profile Picture
    on at

    i have already go through on it but no thing effective found

  • Suggested answer
    Chaitanya Golla Profile Picture
    17,225 on at

    Hi,

    Please use following code/job to get number of days for a given date

    static void AXC_NoOfDays(Args _args)
    {
        date d = mkDate(12,11,2017);
        int FromDays, ToDays;   
        
        FromDays = date2num(DateStartMth(d)); 
        
        todays = date2num(endmth(d));
        
        info(strFmt("No of days: %1", (ToDays+1) - FromDays));
    }

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

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans