X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 3EBDF9DCAA5 for ; Sat, 3 Dec 2005 14:01:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 92378-10 for ; Sat, 3 Dec 2005 14:00:57 -0400 (AST) X-Greylist: delayed 00:06:37.041591 by SQLgrey- Received: from web31712.mail.mud.yahoo.com (web31712.mail.mud.yahoo.com [68.142.201.192]) by postgresql.org (Postfix) with SMTP id 9BDFF9DCA94 for ; Sat, 3 Dec 2005 14:00:57 -0400 (AST) Received: (qmail 31458 invoked by uid 60001); 3 Dec 2005 17:54:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LqKUMtBWfWjcKR4N+J09s/FLOC4D6rwmcPevC7YmNCKv4YIgTeCxNKQZq0+TtV0rLBdXN3cJ2TlEla7uU0BG3qIFsdh8sHqPnxH/gh3e6ZxsVPdRszstQQ56hLGLg3oCkow7LtedBu2pgCwGqJDfoxjrv4MlekXrAo3vcYlq8ok= ; Message-ID: <20051203175416.31456.qmail@web31712.mail.mud.yahoo.com> Received: from [151.204.106.98] by web31712.mail.mud.yahoo.com via HTTP; Sat, 03 Dec 2005 09:54:16 PST Date: Sat, 3 Dec 2005 09:54:16 -0800 (PST) From: Theodore Petrosky Subject: question using 'between' in a sql query To: postgres SQL MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.479 required=5 tests=[DNS_FROM_RFC_ABUSE=0.479] X-Spam-Score: 0.479 X-Spam-Level: X-Archive-Number: 200512/12 X-Sequence-Number: 23554 My table create table mytable ( employeecode text, info text, somestuff text, insertdate timestamp with time zone); I have an interface where the user can query for all employeecode between two dates. I assumed from the docs that: SELECT employeecode FROM mytable WHERE insertdate BETWEEN '11/20/2005' AND '11/20/2005' would yield an inclusive result set. I am being lazy and I didn't want to check if the user was looking for just one day.... (it looks like I will have to not be lazy). Is this correct behavior? if 'between' is inclusive of the start and end dates why doesn't this query result in all the rows on '11/20/2005'? BTW this is 8.1 on OS X 10.4.3 Ted __________________________________________ Yahoo! DSL – Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com