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 get today's +1 date in Dynamics Ax2009 X++?

(0) ShareShare
ReportReport
Posted on by

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

I have the same question (0)
  • raelhefn Profile Picture
    on at

    static void IncDate(Args _args)

    {

       TransDate transDate = 16\02\2009;

       ;

       transDate++;

       print transDate;

       pause;

    }

    to get today date

    use systemDateGet() + 1  function

  • Community Member Profile Picture
    on at

    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

  • Verified answer
    Community Member Profile Picture
    on at

    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"
  • Jesus R. ABASCAL Profile Picture
    1,450 on at

    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!

  • raelhefn Profile Picture
    on at

    select firstonly <Your Table>

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

    or

    while select <Your Table>

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

    {

      value = value + X;

    }

  • Community Member Profile Picture
    on at

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

    Thanks Jan-Luuc

  • Community Member Profile Picture
    on at

    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
    on at

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

  • Verified answer
    Community Member Profile Picture
    on at

    this one: (dayRange(0,1))

  • Community Member Profile Picture
    on at

    Thanks this works!

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