Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 9A168476575 for ; Tue, 27 Aug 2002 05:52:46 -0400 (EDT) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 3E708476573 for ; Tue, 27 Aug 2002 05:52:46 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 86162381D17; Tue, 27 Aug 2002 05:52:45 -0400 (EDT) From: "Emmanuel Guyot" X-Newsgroups: comp.databases.postgresql.sql Subject: Year of the week : How to ? Date: Tue, 27 Aug 2002 11:52:46 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 15 Message-ID: X-Complaints-To: news@hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200208/386 X-Sequence-Number: 9232 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 Montées 45100 Orléans Web site : http://www.increg.com