Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 2261F2E304F for ; Fri, 14 Mar 2008 13:09:38 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 81493-02-7 for ; Fri, 14 Mar 2008 13:09:25 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tomts5-srv.bellnexxia.net (tomts5.bellnexxia.net [209.226.175.25]) by postgresql.org (Postfix) with ESMTP id 48B972E0234 for ; Fri, 14 Mar 2008 13:09:21 -0300 (ADT) Received: from toip3.srvr.bell.ca ([209.226.175.86]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20080314160919.GDJJ1572.tomts5-srv.bellnexxia.net@toip3.srvr.bell.ca> for ; Fri, 14 Mar 2008 12:09:19 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4FAHNA2kdBX4fQ/2dsb2JhbACBWqgG Received: from bas3-london14-1096779728.dsl.bell.ca (HELO t60p.bax.ca) ([65.95.135.208]) by toip3.srvr.bell.ca with ESMTP; 14 Mar 2008 12:04:48 -0400 Message-ID: <47DAA330.8070409@sympatico.ca> Date: Fri, 14 Mar 2008 12:09:20 -0400 From: Frank Bax User-Agent: Thunderbird 2.0.0.6 (X11/20070818) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Counting days ... References: <200803132025.27821.aarni@kymi.com> <47DA8108.1020104@sympatico.ca> <47DA848A.9000700@sympatico.ca> <200803141713.40589.aarni@kymi.com> In-Reply-To: <200803141713.40589.aarni@kymi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/85 X-Sequence-Number: 30413 Aarni Ruuhimäki wrote: > Thanks Frank, > >>> a start_day before period_start, end_day before period_start > > This I don't have to care about as it is not in the period we are looking at. > >>> b start_day = period_start, end_day = period_start > > Is zero days/nights, ignored. Not even possible to insert in the application. > end_day must be greater than start_day. You should still consider rows that are "out of range" or "zero nights" in your test cases to make sure your report processes them correctly.