Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX forum
Answered

how to get month name and month number from a given date of TransDate type?

Posted on by Microsoft Employee

i have a date of transDate type and i want the month name in string format and the month number.

plz help.

regards

rajesh mahato

Categories:
  • Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: how to get month name and month number from a given date of TransDate type?

    Hi Rajesh,

    I replied on on your other thread. Please check that job/code.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to get month name and month number from a given date of TransDate type?

    That thread is a long one and confusing also.

    the above solution provided by chaitanya golla is very well explained.

    sorry for multiple thread

    regards

    rajesh

  • Rohin Profile Picture
    Rohin 4,622 on at
    RE: how to get month name and month number from a given date of TransDate type?

    Vilmos suggested you the same on your last thread. Please don't create multiple thread for same questions.

  • Verified answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: how to get month name and month number from a given date of TransDate type?

    Hi,

    Please use the following job to get Month number and name.

    static void Month(Args _args)
    
    {
    
       TransDate d = systemDateGet();
    
       int number;
    
       number = mthOfYr(systemdateget());
    
       info(strFmt("Month Number: %1", number));
    
       info(strFmt("Month Name: %1", mthName(number)));
    
    }


Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,989 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans