intvMax Function

Returns the number of intervals for the specified period when dividing the period into parts as specified by func.


int intvMax(date input_date, date ref_date, int func)

Parameter

Description

input_date

The end of the period.

ref_date

The start of the period.

func

The division unit.

Use the system enum IntvScale to get the correct func number. Possible values are:

  • None

  • YearMonthDay

  • YearMonth

  • Year

  • MonthDay

  • Month

  • Day

  • YearQuarter

  • Quarter

  • YearWeek

  • Week

  • WeekDay

static void intvMaxExample()
{
    date refDate = str2Date("4/9/2007", 213);
    date inputDate = str2Date("10/5/2007", 213);
    int numberOfIntervals;
    ;
    numberOfIntervals = intvMax(inputDate, refDate, intvScale::YearMonth);
    print numberOfIntervals;
    pause;
}

Community Additions

ADD
Show: