Re: last dtae of the month

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Rajesh nalankal <rajeshnalankal(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: last dtae of the month
Date: 2004-10-03 14:44:38
Message-ID: 20041003144438.GA28877@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Mike Rylander 2004-10-03 14:49:12 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)
Previous Message Gaetano Mendola 2004-10-03 11:18:27 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd