Skip site navigation (1) Skip section navigation (2)

Re: Last day of month

From: Joe Conway <mail(at)joeconway(dot)com>
To: Greg Sabino Mullane <greg(at)turnstep(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org, sgnerd(at)yahoo(dot)com(dot)sg
Subject: Re: Last day of month
Date: 2004-02-26 04:30:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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.

oops...forget my last reply...I was a bit too quick on the draw. Try 
this instead:

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


In response to


pgsql-sql by date

Next:From: Sumita Biswas (sbiswas)Date: 2004-02-26 05:51:12
Subject: Unicode Support
Previous:From: Joe ConwayDate: 2004-02-26 04:27:57
Subject: Re: Last day of month

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group