How to find the last day os the month in postgres? I have a date columns stored as numeric(18) in the format(YYYYMMDD) I am trying it to make it date using
For future searches, Redshift does not accept INTERVAL '1 month'. Instead use dateadd(month, 1, date) as documented here.
INTERVAL '1 month'
dateadd(month, 1, date)
To get the end of the month use: DATEADD(DAY, -1, (DATE_TRUNC('month', DATEADD(MONTH, 1, date))))
DATEADD(DAY, -1, (DATE_TRUNC('month', DATEADD(MONTH, 1, date))))