Monday 10 July 2017

Looping dates and finding months between the dates

static void LoopDates(Args _args)
{
    TransDate date1 = 15\8\2017;
    TransDate date2 = 21\10\2017;  
   
    while (mthOfYr(date1) <= mthOfYr(date2) || mthOfYr(date2) <= mthOfYr(date1))
    {
        info(strfmt("%1",mthName(mthOfYr(date1))));
        date1 = dateMthFwd(date1,1);

        if (mthOfYr(date1) == mthOfYr(date2))
        {
            info(strfmt("%1",mthName(mthOfYr(date1))));
            break;
        }
    }
}


No comments:

Post a Comment

Calculate ledger balance by dimension set in X++ in AX2012/Dynamics 365 FO

There are a variety of ways users can view balances in the general ledger. Some of the most common options are: 1. Trial balance 2. Financia...