LAST_DAY returns the last day of the month.

Syntax

LAST_DAY ( dateValue)

Arguments

dateValue: A DATE or TIMESTAMP value.

Returns

  • An DATE of the last day in the month.

Examples

SELECT LAST_DAY('2013-07-23 23:59:59'), LAST_DAY(tstamp_0), LAST_DAY(date_1), LAST_DAY(tstamp_6), tstamp_6
FROM "redshift1.inventory.2012data";

-- Could return
2013-07-31 00:00:00.0   2000-12-31 00:00:00.0   2000-12-31 00:00:00.0   2000-12-31 00:00:00.0     2000-12-31 23:59:50.100222