Year of the week : How to ?

From: "Emmanuel Guyot" <emmguyot(at)wanadoo(dot)fr>
To: pgsql-sql(at)postgresql(dot)org
Subject: Year of the week : How to ?
Date: 2002-08-27 09:52:46
Message-ID: akfi5c$23i1$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

How to retrieve the year based on week of a date ?

If I use datepart('year', aDate), I get the year of the date.
If I use datepart('week', aDate), I get the week of the date.
But these aren't corelated. So when aDate is Dec 31st 2001, I get 2001, and
the week is 1. I'd like to have 2002 for the year in this case.

Is there a simple way to do this ?

Emmanuel Guyot
8 Rue des Montes
45100 Orlans
Web site : http://www.increg.com

Browse pgsql-sql by date

  From Date Subject
Next Message Mathieu Arnold 2002-08-27 16:18:07 triggers and plpgsql question
Previous Message Mowat, Paul 2002-08-27 09:20:58 Help needed