Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

How to get today's +1 date in Dynamics Ax2009 X++?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Need to be able to select today's + 1 date function inside dynamics ax2009,

As we require this to run a sales orders select.. any help would be appreciated on this

Thanks

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    Thanks this works!

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    this one: (dayRange(0,1))

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    (day(0))..(day(1)), edit, that doesn't work :). 

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    Hi,

    I have just attempted to enter one of the above however it pulls back all results of sales orders on tomorrow's date,

    however we require all of current date's results + tomorrow's which Query would we require to meet this ?

    Thanks in advance

    Jordan

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    That's Great, that's exactly what we need

    Thanks Jan-Luuc

  • raelhefn Profile Picture
    raelhefn on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    select firstonly <Your Table>

       where <Your Table>.TransDate > systemDateGet() +1 ;

    or

    while select <Your Table>

       where <Your Table>.TransDate > systemDateGet() +1 ;

    {

      value = value + X;

    }

  • Jesus R. ABASCAL Profile Picture
    Jesus R. ABASCAL 1,450 on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    Hi,

    You have many options according your requirements:

    info(date2StrXpp(today()+1));
    info(DateTimeUtil::toStr(DateTimeUtil::addDays(DateTimeUtil::utcNow(),1)));
    info(date2StrXpp(systemDateGet()+1));

    Regards!

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    Hi Jordan,

    You probably mean a selection in a query, for this you can use the SysQueryRangeUtil.

    Below some examples, you can use this in query's so you can use them in recurring batches without the need to change it daily. Give it a try in a testenvironment to see if it meets your requirements. Simply key in the bold statement below in a datefield. In your case it would be (greaterThanDate(1)).

    • (dayRange(-30,0)) - Results in a date range for the last 30 days: "26-01-2014".."25-02-2014"
    • (day(-1)) - Results in yesterday's date: 24-02-2014
    • (day(0)) - Results in today's date: 25-02-2014
    • (day(1)) - Results in tomorrow's date: 26-02-2014
    • (greaterThanDate(2)) - Results in every date after today plus 2: > 27-02-2014
    • (lessThanDate(-1)) - Results in every date of today minus 1: < 24-02-2014
    • (monthRange(0,2)) - Results in first day till the last day of the month's choosen (0 = current month): "01-02-2014".."30-04-2014"
    • (yearRange(-1,-1)) - Results in first day till the last day of the chosen year: "01-01-2013".."31-12-2013"
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    Thanks for the reply,

    unfortunately I don't need it to create a class.. I just need the select command (single line) to enter in a GUI selection if possible

  • raelhefn Profile Picture
    raelhefn on at
    RE: How to get today's +1 date in Dynamics Ax2009 X++?

    static void IncDate(Args _args)

    {

       TransDate transDate = 16\02\2009;

       ;

       transDate++;

       print transDate;

       pause;

    }

    to get today date

    use systemDateGet() + 1  function

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,836 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans