In Dynamics AX, X++, how do you increment a date variable

ash picture ash · May 22, 2009 · Viewed 8.6k times · Source

I am not sure if it is something with xslt or xpath..but how do I increment a date by 1 day? For example, if the date is 2/16/2009 I want the date to be incremented by 1 to become 2/17/2009 etc. etc.

Answer

10p picture 10p · Mar 9, 2011

Incrementing a date variable in X++, Dynamics AX:

static void IncDate(Args _args)
{
    TransDate transDate = 16\02\2009;
    ;

    transDate++;

    print transDate;
    pause;
}

Result: 17/02/2009