Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 35FD09FB590 for ; Tue, 15 May 2007 05:53:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 33232-06 for ; Tue, 15 May 2007 05:53:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.ringways.co.uk (unknown [80.193.83.131]) by postgresql.org (Postfix) with ESMTP id 80C239FB58F for ; Tue, 15 May 2007 05:53:36 -0300 (ADT) Received: from eddie.ringways.co.uk ([10.1.1.115]) by mail.ringways.co.uk with esmtp (Exim 4.62) (envelope-from ) id 1Hnsgx-0001bA-C9 for pgsql-sql@postgresql.org; Tue, 15 May 2007 09:47:35 +0100 From: Gary Stainburn Organization: Ringways Garages Ltd To: pgsql-sql@postgresql.org Subject: workday function Date: Tue, 15 May 2007 09:51:34 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705150951.34928.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/122 X-Sequence-Number: 28402 Hi folks I need to be able to add and subtract workdays, something like select CURRENT_DATE - '3 work days'::interval; I can't see how to do this natively so I'm looking to write a function to do it and was wondering if anyone's already done it. While Googling I've found that MS Excel has a workday function which seems to do what I want. Any help would be appreciated. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000