SELECT the last day of the month
suggest changeYou can select the last day of a month.
SELECT (date_trunc('MONTH', ('201608'||'01')::date) + INTERVAL '1 MONTH - 1 day')::DATE;
Replace 201608 with another YYYYMM value. The expression truncates to the first of that month, adds one month, then subtracts one day.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents