X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id C4C5B30EFC2 for ; Tue, 17 Jun 2003 03:37:46 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 15288-07 for ; Tue, 17 Jun 2003 00:37:36 -0300 (ADT) Received: from sunny1.pacific.net.ph (sunny1.pacific.net.ph [210.23.234.92]) by svr1.postgresql.org (Postfix) with ESMTP id 3437D30EF92 for ; Tue, 17 Jun 2003 00:37:35 -0300 (ADT) Received: from pop2.pacific.net.ph (pop2.pacific.net.ph [210.23.234.90]) by sunny1.pacific.net.ph with ESMTP id h5H3bWpN012514 for ; Tue, 17 Jun 2003 11:37:32 +0800 (PHT) Received: from arwen.hq.astra.ph ([210.23.117.72]) by pop2.pacific.net.ph with ESMTP id h5H3bVY3008828 for ; Tue, 17 Jun 2003 11:37:32 +0800 (PHT) Subject: Re: select date range? From: "Ramil G. Sagum" Reply-To: ramil@astra.ph To: pgsql-sql@postgresql.org In-Reply-To: <02c101c3347c$1279d830$c9641cac@myko> References: <02c101c3347c$1279d830$c9641cac@myko> Content-Type: text/plain Organization: ASTRA Philippines Message-Id: <1055821427.29605.53.camel@arwen.hq.astra.ph> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 17 Jun 2003 11:43:47 +0800 Content-Transfer-Encoding: 7bit X-Archive-Number: 200306/169 X-Sequence-Number: 13927 hmm it should work fine. Remember, the statement ....where mydate between '2003/05/12' and '2003/06/17' would ONLY return records from '2003/05/12 to 2003/06/16 since your type is a timestamp. 2003/06/17 actually means 2003/06/17 00:00:00.000000+00. so a timestamp of 2003/06/17 03:01:10.102022+08 would not be included in the query. got it? ramil On Tue, 2003-06-17 at 10:56, ko wrote: > Hi, > > When I use sql statement to select the date range from $_POST value,It > doesn't work. > > ------------------------------------------- > "select * from mydatabase where mydate between '$_POST[start_date]' > and '$_POST[end_date]' " > > There is no error,but the result is not I want. > > ps: > (1)mydate attribute is timestamp > (2)$_POST[start_date] is something like '2003/05/12' >