EOMONTH

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.

Syntax

EOMONTH(
    start_date,
    months
)

Parameters
  • 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.
Returned value

The EOMONTH function returns a date in datetime format.

Additional Information

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.

Examples

This example applies the function to multiple dates:

EOMONTH command. Example of use

If we use this function indicating the value zero as the number of months, it returns the last day of the current month:

EOMONTH command. Example of use

Category
Date and time
Submitted by admin on Mon, 12/03/2018 - 23:24