Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #postgresql #month
ADD COMMENT
Topic
Name
5+4 =