intvNo Function

Returns the number of intervals between the ref-date and the input-date when you divide the time into intervals specified by func.


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

Parameter

Description

input_date

The first date.

ref_date

The second date.

func

An intvScale enumeration.

The number of intervals between the ref-date and the input-date.

static void intvNoExample(Args _args)
{
    date inputDate = str2Date("1/1/2007", 213);
    date refDate = str2Date("3/1/2007", 213);
    int noOfIntervals;
    ;
    noOfIntervals = intvNo(refDate, inputDate, intvScale::Month);
    print noOfIntervals;
    pause;
    //noOfIntervals now holds the difference in months between March and January (2).
}

Community Additions

ADD
Show: