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)

how to change date from one fiscal year to other?

(0) ShareShare
ReportReport
Posted on by

Hi ,

i have table(demotable) with field named 'startDate', now i need to roll over each month and store each months name 
problem is:

how to change & store this date after 31/12/2017 to 01/01/2018

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    István Orosz Profile Picture
    2,137 on at

    Hi,

    What is the exact type of 'startDate'? If you want to add only one day to a date, which is stored as UTCDateTime in your table, you can use the DateTimeUtil::addDays() method.

    Regards,

    István

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    Do you mean by 

    Valid Time State Tables and Date Effective Data [AX 2012]

  • Community Member Profile Picture
    on at

    thanks for the quick response Istvan

    can u tell me if i want to change month wise , what is the function?

  • Suggested answer
    Rohin Profile Picture
    4,624 on at

    then simply use DateTimeUtil::addMonth()

  • Community Member Profile Picture
    on at

    and if i want to add to a user added date of "Transdate" EDT,

    then???

  • Suggested answer
    Vilmos Kintera Profile Picture
    46,149 on at

    Have a look at this:

    [View:https://stoneridgesoftware.com/dynamics-ax-all-about-dates-and-x/:750:50]

    [View:https://msdn.microsoft.com/en-us/library/aa865135.aspx:750:50]

    As you see in the documentation, you can offset it in multiple ways. Add/subtract days, or int values, etc.

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

    Hi,

    You can use the following job/code to get the month names between given date intervals

    static void MonthName(Args _args)
    {
        TransDate startDate, EndDate; 
        int number;
        
        startDate = mkDate(31,12,2017);
        endDate = mkDate(1,1,2018);
    
        
        while (startDate < EndDate)
        {
            number = mthOfYr(startDate);
            info(strFmt("Month Name: %1", mthName(number)));
            
            startDate = nextMth(startDate);
        }
    }
  • Suggested answer
    István Orosz Profile Picture
    2,137 on at

    Hi,

    TransDate is originated from Date, which does not contain time zone infromation, maybe the simplest way is to convert it into UTCDateTime and use the methods of DateTimeUtil class.

    Regards,

    István

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