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

Syntax

MonthDiff("dateFrom","dateTo");

Function arguments

  • dateFrom – (String) The first date.
  • dateTo – (String) The second date.

Return value

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

Examples

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] );
Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.