X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 1F0275E46BF for ; Fri, 6 Aug 2004 18:28:58 -0300 (ADT) 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 23855-03 for ; Fri, 6 Aug 2004 21:28:58 +0000 (GMT) Received: from misav08.sasknet.sk.ca (misav08.sasknet.sk.ca [142.165.20.172]) by svr1.postgresql.org (Postfix) with ESMTP id B86F35E4699 for ; Fri, 6 Aug 2004 18:28:54 -0300 (ADT) Received: from oregano.sasktel.net ([142.165.20.197]) by 142.165.20.172 with InterScan Messaging Security Suite; Fri, 06 Aug 2004 15:28:55 -0600 Received: from borderveygqj37 (hssx-estv-30-169.sasknet.sk.ca [142.165.30.169]) by oregano.sasktel.net (SaskTel eMessaging Service) with ESMTPA id <0I210093PNO2OQ@oregano.sasktel.net> for pgsql-sql@postgresql.org; Fri, 06 Aug 2004 15:28:54 -0600 (CST) Date: Fri, 06 Aug 2004 15:29:10 -0600 From: Caleb Simonyi-Gindele Subject: Grouping by week In-reply-to: To: pgsql-sql@postgresql.org Message-id: <000001c47bfc$69d79e50$c201a8c0@borderveygqj37> MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Mailer: Microsoft Outlook, Build 10.0.6626 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Importance: Normal X-Priority: 3 (Normal) X-MSMail-priority: Normal X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/42 X-Sequence-Number: 18539 I'm using SELECT EXTRACT(WEEK FROM trans_date), SUM(tran_amount) ... GROUP BY trans_date and it is being used to group sales results by week. It works really well. What I'm wondering is if I can shift the week from a Mon-Sun articulation(default with Postgre) to a Sun-Sat sequence. I need it that way in order to comply with a legacy stats system. Thanks, Caleb