Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9272047779B for ; Fri, 21 Jun 2002 17:17:47 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 8FAB34776C3 for ; Fri, 21 Jun 2002 15:31:23 -0400 (EDT) Received: from [216.135.165.74] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1552107; Fri, 21 Jun 2002 12:31:23 -0700 From: "Josh Berkus" Subject: Re: SQL Challenge: Skip Weekends To: Joe Conway , josh@agliodbs.com Cc: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Fri, 21 Jun 2002 12:31:23 -0700 Message-ID: In-Reply-To: <3D12BA7F.1090209@joeconway.com> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200206/305 X-Sequence-Number: 8270 Joe, > How about this (a bit ugly, but I think it does what you want -- > minus the holidays, which you said you already have figured out): > > create or replace function > get_future_work_day(timestamp, int) Thank you. Once again, you come to the rescue when I'm stuck. I'll try your solution and Jean-Luc's, and see which works better/faster. And report back. -Josh Berkus