Extract date from week

From: lucas(at)presserv(dot)org
To: pgsql-sql(at)postgresql(dot)org
Subject: Extract date from week
Date: 2005-11-08 11:25:11
Message-ID: 20051108082511.06n26rf2fc0gk8cg@www.presserv.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi
Looking the e-mail I remembered a question.
I saw that "select extract (week from now()::date)" will return the
week number
of current year. But, how can I convert a week to the first reference
date. Ex:
select extract(week from '20050105'::date); -- 5 Jan 2005
--Returns--
date_part |
1 |

It is the first week of year (2005), and how can I get what is the first date
references the week 1? Ex:
select ???? week 1
--should return---
date |
20050103 | -- 3 Jan 2005

Thank you.
Lucas Vendramin

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message codeWarrior 2005-11-08 16:19:58 Re: Returning rows as columns
Previous Message Robert Blixt 2005-11-08 06:52:57 Re: Extract week from date, start with sunday