> Hello,
>
> Does anyone happen to have a function, prefereably in pl/pgsql, which
> given the month and year will return the last day in that month?
>
Something like this might get you started:
CREATE OR REPLACE FUNCTION public.fom(date)
RETURNS date AS
'
SELECT COALESCE($1, CURRENT_DATE)-EXTRACT(DAY FROM COALESCE($1,
CURRENT_DATE))::INTEGER+1;
'
LANGUAGE 'sql' VOLATILE;
CREATE OR REPLACE FUNCTION public.lom(date)
RETURNS date AS
'
SELECT fom(date (COALESCE($1, CURRENT_DATE) + interval \'1 month\'))-1;
'
LANGUAGE 'sql' VOLATILE;
~Berend Tober