/ Published in: SQL
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
CREATE OR REPLACE FUNCTION LastDateOfMonth(DATE) RETURNS DATE AS ' SELECT CAST(date_trunc(''month'', $1) + interval ''1 month'' - interval ''1 day'' as date); ' LANGUAGE SQL;