Przejdź do głównej zawartości

MonthDiff

Returns the full months count between given dates. Each year is counted as addditional 12 months. Returned value is always positive, even if second parameter presents earlier date than first

MonthDiff("dateFrom","dateTo");
  • dateFrom – (String) The first date.
  • dateTo – (String) The second date.

This function returns Decimal. Returns integer number of months between two dates.

Example 1: Resulting value: 5

months = MonthDiff(2015-06-04, 2015-11-16);

Example 2: Resulting value: 0

months = MonthDiff(2015-06-01, 2015-06-30);

Example 3: Resulting value: 0

months = MonthDiff(2015-06-30, 2015-07-01);

Example 4: Resulting value: 9

months = MonthDiff(2015-06-01, 2016-03-30);

Example 5: Resulting value: 9

months = MonthDiff(2016-06-01, 2015-03-30);

Example 6: This will count full months number between dates stored in ’Date from’ and ’Date to’ case fields

result = MonthDiff( [Date from], [Date to] );