STD.Date.MonthsBetween( fromDate, toDate)
fromDate | The first date value in Date_t format. |
toDate | The last date value in Date_t format. |
month_ends_equal | Optional. If TRUE and both dates fall on the last day of their respective months, the difference between the dates will be treated as whole months regardless of the actual day values. If FALSE then the day value of each date is considered when calculating the difference. The default is FALSE |
Return: | MonthsBetween returns an INTEGER value of the number of whole months between the two dates. |
The MonthsBetween function calculates the number of whole months between two dates.
Example:
IMPORT STD; StartDate := 19631122; numMonths := STD.Date.MonthsBetween(startDate,STD.Date.Today()); // numMonths contains the number of months between the startDate and today's date