Answers for "postgresql get last day of month"

SQL
0

postgresql get last day of month

SELECT (date_trunc('month', '2017-01-05'::date) + interval '1 month' - interval '1 day')::date
AS end_of_month;
Posted by: Guest on March-05-2021
0

postgresql get last day of month

create function end_of_month(date)
returns date as
$$
select (date_trunc('month', $1) + interval '1 month' - interval '1 day')::date;
$$ language 'sql'
immutable strict;
Posted by: Guest on March-05-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language