[EMAIL PROTECTED] (Sergey Pariev) writes:
> I need to find out the last day of current month. Currently I do the
> trick with code below, but that's rather ugly way to do it IMHO. Could
> anybody suggest me a better way ?
log_analysis=# select date_trunc('months', (date_trunc('months', now()) + '
9 29 36 18
---
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Sergey Pariev
Sent: jeudi 25 aout 2005 18:44
To: pgsql-general postgresql.org
Subject: [GENERAL] getting last day of month
Hi all.
I need t
Sergey Pariev schrieb:
Hi all.
I need to find out the last day of current month. Currently I do the
trick with code below, but that's rather ugly way to do it IMHO. Could
anybody suggest me a better way ?
The following is my testing procedure :
CREATE or REPLACE FUNCTION test_findout_dates()
Sergey,
Try this one:
CREATE OR REPLACE FUNCTION public.lastdayofmonth(date)
RETURNS date AS
'
select ((date_trunc(\'month\', $1) + interval \'1 month\') - interval
\'1 day\')::date;
'
LANGUAGE 'sql' VOLATILE;
Sergey Pariev wrote:
Hi all.
I need to find out the last day of current mon
Sergey Pariev wrote:
> Hi all.
> I need to find out the last day of current month. Currently I do the
> trick with code below, but that's rather ugly way to do it IMHO. Could
> anybody suggest me a better way ?
select '2005-09-01'::date-'1 day'::interval does the trick :)
--
Wbr, Sergey Moiseev
-
Hi all.
I need to find out the last day of current month. Currently I do the
trick with code below, but that's rather ugly way to do it IMHO. Could
anybody suggest me a better way ?
The following is my testing procedure :
CREATE or REPLACE FUNCTION test_findout_dates()
RETURNS integer AS $$
D