Re: grabbing date of last Sunday?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: blackwater dev <blackwaterdev(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: grabbing date of last Sunday?
Date: 2008-10-10 15:36:29
Message-ID: 48EF767D.5030105@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/10/2008 16:29, blackwater dev wrote:
> How can I grab the date from the last Sunday based on when I run the query?

select
current_date
- (extract(dow from current_date) || ' days')::interval;

:-)

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2008-10-10 15:59:58 Re: grabbing date of last Sunday?
Previous Message blackwater dev 2008-10-10 15:29:53 grabbing date of last Sunday?