Re: Last day of month - Mailing list pgsql-sql

From Joe Conway
Subject Re: Last day of month
Date
Msg-id 403D75CD.1000109@joeconway.com
Whole thread Raw
In response to Re: Last day of month  ("Greg Sabino Mullane" <greg@turnstep.com>)
List pgsql-sql
Greg Sabino Mullane wrote:
>>How to find the last sunday/mon..../sat of any given month.
>  
> There is probably a smoother way to do it, but here is a
> quick little function to do what you ask. Feed it a date
> and a number, where 0 is Sunday, 1 is Monday, etc.

How about this:

regression=# select date_trunc('month', current_date + '1 month'::interval);     date_trunc
--------------------- 2004-03-01 00:00:00
(1 row)

Joe



pgsql-sql by date:

Previous
From: Kenneth Gonsalves
Date:
Subject: updating remote database
Next
From: Joe Conway
Date:
Subject: Re: Last day of month