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

Re: How can I get the first and last date of a week, based on the week number and the year

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <aklaver(at)comcast(dot)net>
Cc: pgsql-general(at)postgresql(dot)org, Bruno Baguette <bruno(dot)baguette(at)gmail(dot)com>
Subject: Re: How can I get the first and last date of a week, based on the week number and the year
Date: 2008-02-27 06:13:23
Message-ID: 14687.1204092803@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Adrian Klaver <aklaver(at)comcast(dot)net> writes:
> On Tuesday 26 February 2008 8:39 pm, Tom Lane wrote:
>> date_trunc('week', ...) would probably be a more convenient way of doing
>> that.

> I am not sure I follow. The OP has a ISO week number and a year and wants 
> dates. I thought date_trunc('field',source) requires a timestamp or interval 
> as its source. 

Oh, you are right ... I misread the question :-(

			regards, tom lane

In response to

pgsql-general by date

Next:From: Olmec SinclairDate: 2008-02-27 06:42:07
Subject: Re: Trouble running PostgreSQL server / Server must be started under certain locale.
Previous:From: Adrian KlaverDate: 2008-02-27 06:07:56
Subject: Re: How can I get the first and last date of a week, based on the week number and the year

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