Re: How can I get the first and last date of a week, based on the week number and the year - Mailing list pgsql-general

From Tom Lane
Subject Re: How can I get the first and last date of a week, based on the week number and the year
Date
Msg-id 13475.1204087141@sss.pgh.pa.us
Whole thread Raw
In response to Re: How can I get the first and last date of a week, based on the week number and the year  (Adrian Klaver <aklaver@comcast.net>)
Responses Re: How can I get the first and last date of a week, based on the week number and the year
List pgsql-general
Adrian Klaver <aklaver@comcast.net> writes:
> On Tuesday 26 February 2008 5:32 pm, Bruno Baguette wrote:
>> I have a week number (ISO 8601) and a year, based on theses values, I
>> would like to get the first and the last dates of that week.

> This will get you to the Monday of the week .

> select to_date('9  08','IW  YY');
>   to_date
> ------------
>  2008-02-25
> (1 row)

date_trunc('week', ...) would probably be a more convenient way of doing
that.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: bug in 8.3? foreign key refers to different type
Next
From: "Hiroshi Saito"
Date:
Subject: Re: UUID-OSSP for windows.