Answers for "postgresql generate each month between dates"

SQL
0

CALCULATING MONTHS BETWEEN TWO DATES IN POSTGRESQL

EXTRACT(year FROM age(end_date,start_date))*12 + EXTRACT(month FROM age(end_date,start_date))
Posted by: Guest on October-19-2021
0

postgresql between month

CREATE OR REPLACE FUNCTION public.fn_getlastofmonth (
  date
)
RETURNS date AS
$body$
begin
    return (to_char(($1 + interval '1 month'),'YYYY-MM') || '-01')::date - 1;
end;
$body$
LANGUAGE 'plpgsql'
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
COST 100;
Posted by: Guest on October-08-2021

Code answers related to "postgresql generate each month between dates"

Code answers related to "SQL"

Browse Popular Code Answers by Language