X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AD382D7C6B for ; Mon, 7 Nov 2005 10:00:39 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 81370-02 for ; Mon, 7 Nov 2005 14:00:35 +0000 (GMT) X-Greylist: delayed 00:13:01.678821 by SQLgrey- Received: from mail.mits.se (unknown [194.236.40.10]) by svr1.postgresql.org (Postfix) with ESMTP id 11DC6D6873 for ; Mon, 7 Nov 2005 10:00:36 -0400 (AST) Received: from robertsdator ([192.168.0.27]) by mail.mits.se (mail.mits.se) with ESMTP id KYC00036 for ; Mon, 7 Nov 2005 14:47:36 +0100 From: "Robert Blixt" To: Subject: Extract week from date, start with sunday Date: Mon, 7 Nov 2005 14:47:35 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcXjoc9J6FO0hmgkS7KYDbKpyldTmg== Message-Id: <20051107140036.11DC6D6873@svr1.postgresql.org> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.927 required=5 tests=[MSGID_FROM_MTA_ID=0.927] X-Spam-Score: 0.927 X-Spam-Level: X-Archive-Number: 200511/64 X-Sequence-Number: 23315 Hi, I am currently extracting my weeks from a date like this.. SELECT INTO extractweek EXTRACT( week FROM ldate ); This works fine, except that this assumes (according to ISO standard) that weeks starts with Monday. I need the weeks to start with Sunday instead, otherwise I will not get the correct week. Is there a workaround for this? Thanks! Kind Regards, Robert