Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id BF1359FB52E for ; Tue, 15 May 2007 09:03:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 57659-10 for ; Tue, 15 May 2007 09:02:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.226]) by postgresql.org (Postfix) with ESMTP id EFE169FB4EF for ; Tue, 15 May 2007 09:03:03 -0300 (ADT) Received: by wx-out-0506.google.com with SMTP id i28so1788236wxd for ; Tue, 15 May 2007 05:03:02 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S1D0krs0VFMelCcwkro3d1tMlNNshyTwoCrwZ/Cx+q2pWIp01IsJmrL4PP3rVqSI2JXxG+9/1znU2Od3CLPvfHN1dZMPi3CBwBBh0f81kzMf7UK8mYPblxE5ZOrqHYYql8I61gRZ+gBbFiC3e7w++h/U/Kvqf03Tq1xNKHtRqfk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=UJRMTZ9S+QBiGhGfPU3C0clebc6B/p3sjP4xRUhE011j5aYB33JRtyuevBC+mj/bGiiwukEW2FE2DDa3GsMAWH4ZZjk3rQi94OdiYcFFJyupa+wOcFFWvuYfVWzmv605LReXp0PoKkWhDNDMEzqu89JCQ58nDopZCm194Sp9GXg= Received: by 10.90.115.9 with SMTP id n9mr5891507agc.1179230581726; Tue, 15 May 2007 05:03:01 -0700 (PDT) Received: by 10.90.100.8 with HTTP; Tue, 15 May 2007 05:03:01 -0700 (PDT) Message-ID: <162867790705150503u5bed45c7w9d77cc186ac29e2e@mail.gmail.com> Date: Tue, 15 May 2007 14:03:01 +0200 From: "Pavel Stehule" To: "Gary Stainburn" Subject: Re: workday function Cc: pgsql-sql@postgresql.org In-Reply-To: <200705150951.34928.gary.stainburn@ringways.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200705150951.34928.gary.stainburn@ringways.co.uk> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/129 X-Sequence-Number: 28409 Hello You can use functions from Orafce package http://www.pgsql.cz/index.php/Oracle_functionality_%28en%29#PLVdate sample: SELECT plvdate.plvdate.default_holydays('czech'); SELECT plvdate.add_bizdays(CURRENT_DATE, 10); SELECT plvdate.isbizday('2006-12-25'); Regards Pavel Stehule 2007/5/15, Gary Stainburn : > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 5: don't forget to increase your free space map settings >