Sunday, November 16, 2014

Date interval Month

// Date Between the interval Month

static void dateintervalmonth(Args _args)
{
    date d,f;
    int i,months;
    int interval = 8;
    d = mkDate(01,02,2014);
    f = mkDate(01,11,2013);
 
    months = intvNo(d,f,intvScale::YearMonth);
    info(strFmt("%1",months));
 
    for(i = 0;i<= months; i++)
    {
        info(strFmt("%1 - %2",mthname(mthofYr(d)),year(d)));
        d = prevmth(d);
    }
}

No comments:

Post a Comment

Search hierarchy for a match (TableALLGroup) X++

  Table1 ppt;  select firstonly ppt  order ItemCode, ItemRelation, AccountCode, AccountRelation where      (ppt.ItemCode == TableGroupAll::T...