skip to main content
Corticon Studio: Rule Language Guide : Rule operator details and examples : Months between
 

Try Corticon Now

Months between

SYNTAX

<DateTime1>.monthsBetween(<DateTime2>)
<Date1>.monthsBetween(<Date2>)

DESCRIPTION

Returns the Integer number of months between DateTimes or between Dates. The month and year portions of the date data are subtracted to calculate the number of elapsed months. The day portions are ignored. If the month and year portions are the same, the result is zero. This function returns a positive number if <DateTime2> is later than <DateTime1>.

USAGE RESTRICTIONS

The Operators row of the table in Summary Table of Vocabulary Usage Restriction applies. No special exceptions.

RULESHEET EXAMPLE

The following Rulesheet uses .monthsBetween to determine the number of months that have elapsed between dateTime1 and dateTime2, compare it to the values in the Condition Cells, and assign a value to string1.

SAMPLE RULETEST

A sample Ruletest provides dateTime1 and dateTime2 for two examples. Input and Output panels are shown below. Notice the variations in date masks (formats).