Posted By

arunpjohny on 10/19/07


Tagged


Versions (?)

Get the last date a given month


 / Published in: SQL
 

  1. CREATE OR REPLACE FUNCTION LastDateOfMonth(date) RETURNS date AS '
  2. SELECT CAST(date_trunc(''month'', $1) + interval ''1 month''
  3. - interval ''1 day'' as date);
  4. ' LANGUAGE sql;

Report this snippet  

You need to login to post a comment.