Re: last dtae of the month - Mailing list pgsql-novice

From Michael Fuhr
Subject Re: last dtae of the month
Date
Msg-id 20041003144438.GA28877@winnie.fuhr.org
Whole thread Raw
In response to last dtae of the month  (Rajesh nalankal <rajeshnalankal@yahoo.com>)
List pgsql-novice
On Sat, Oct 02, 2004 at 11:41:37PM -0700, Rajesh nalankal wrote:
>
> here is my function to get last day of the month. but it causes
> error while executing.
[snip]
> is there any other alternative to this function like  a builtin
> function like last_day

This should get you started:

SELECT date_trunc('month', CURRENT_DATE + INTERVAL'1 month') - INTERVAL'1 day';

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-novice by date:

Previous
From: Rajesh nalankal
Date:
Subject: last dtae of the month
Next
From: Vitaly Belman
Date:
Subject: Re: Writing plpgsql not in a function (directly from plsql)?