The EOMONTH ("End Of Month") function receives a date as a parameter and returns the date corresponding to the last day of the month a number of months before or after the specified date.
EOMONTH(
start_date,
months
)
- start_date: Reference date in datetime or text format.
- months: Integer (positive or negative) that represents the number of months before or after the start_date date from which to return the last day.
The EOMONTH function returns a date in datetime format.
If the date given as a parameter is in text format, the EOMONTH function uses the local date and time setting to interpret it. This means that if the local representation of a date has the form "day/month/year", the text string "7/5/2016" will be interpreted as July 5, 2016. On the contrary, if the local representation of a date has the form "month/day/year", this text string would be interpreted as May 7, 2016.
If the number of months indicated as a parameter is not an integer, it is rounded to the nearest integer.
This example applies the function to multiple dates:
If we use this function indicating the value zero as the number of months, it returns the last day of the current month: