X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 6F965D1B456 for ; Mon, 16 Feb 2004 13:03:30 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 06514-07 for ; Mon, 16 Feb 2004 09:03:31 -0400 (AST) Received: from anchor-post-37.mail.demon.net (anchor-post-36.mail.demon.net [194.217.242.86]) by svr1.postgresql.org (Postfix) with ESMTP id D02CBD1D8B7 for ; Mon, 16 Feb 2004 09:03:12 -0400 (AST) Received: from mwynhau.demon.co.uk ([193.237.186.96] helo=mainbox.archonet.com) by anchor-post-37.mail.demon.net with esmtp (Exim 3.35 #1) id 1AsiP5-000Gdr-0b; Mon, 16 Feb 2004 13:03:16 +0000 Received: by mainbox.archonet.com (Postfix, from userid 529) id 4D7CB16621; Mon, 16 Feb 2004 13:03:14 +0000 (GMT) Received: from client17.archonet.com (client17.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 192F91633C; Mon, 16 Feb 2004 13:03:13 +0000 (GMT) From: Richard Huxton To: "Kumar" , "psql" Subject: Re: Getting the week of a date Date: Mon, 16 Feb 2004 13:03:12 +0000 User-Agent: KMail/1.5 References: <00f701c3f485$d7091430$7502a8c0@hdsc.com> In-Reply-To: <00f701c3f485$d7091430$7502a8c0@hdsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402161303.12330.dev@archonet.com> X-Bogosity: No, tests=bogofilter, spamicity=0.000000, version=0.15.3 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/195 X-Sequence-Number: 16885 On Monday 16 February 2004 12:10, Kumar wrote: > > test=# select date_trunc('week',current_date + ('5 month')::INTERVAL); > ERROR: TIMESTAMP units 'week' not supported Try EXTRACT(week FROM ...) -- Richard Huxton Archonet Ltd