CALCULATING MONTHS BETWEEN TWO DATES IN POSTGRESQL
EXTRACT(year FROM age(end_date,start_date))*12 + EXTRACT(month FROM age(end_date,start_date))
CALCULATING MONTHS BETWEEN TWO DATES IN POSTGRESQL
EXTRACT(year FROM age(end_date,start_date))*12 + EXTRACT(month FROM age(end_date,start_date))
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;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us