EOMONTH Function

Returns the last day of the month containing the specified date.

Syntax

EOMONTH(date, [months-to-add])

Parameters

Return Value

A date string formatted like "2016-02-29".

Example

PRINT EOMONTH('2016-03-07');  -- "2016-03-31"
PRINT EOMONTH('2016-03-07', 1); -- "2016-04-30"
PRINT EOMONTH('2016-03-07', -1); -- "2016-02-29"
PRINT EOMONTH('2016-01-23 22:06:53.742 -04:00'); -- "2016-01-31"