X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 44818474E61 for ; Mon, 3 Mar 2003 07:32:59 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 52961-03 for ; Mon, 3 Mar 2003 07:32:58 -0500 (EST) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id E9F65474E42 for ; Mon, 3 Mar 2003 07:32:57 -0500 (EST) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 18pp7s-0002ly-0d; Mon, 03 Mar 2003 12:33:00 +0000 Received: from localhost ([127.0.0.1] ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 18pp7c-0002Xd-00; Mon, 03 Mar 2003 12:32:44 +0000 Subject: Re: two dates From: Oliver Elphick To: Richard Huxton Cc: mixo , pgsql-sql In-Reply-To: <200303031209.36970.dev@archonet.com> References: <3E5B1349.80705@beth.uniforum.org.za> <200303031209.36970.dev@archonet.com> Content-Type: text/plain Organization: LFIX Limited Message-Id: <1046694764.2173.132.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 03 Mar 2003 12:32:44 +0000 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200303/65 X-Sequence-Number: 12105 On Mon, 2003-03-03 at 12:09, Richard Huxton wrote: > What is wrong with SELECT id FROM foo WHERE created_date>='2003-01-01' AND > created_date<='2003-01-07' or similar? I don't see why you need multiple > queries, perhaps I have misunderstood The BETWEEN operator is provided for this precise requirement: SELECT id FROM foo WHERE created_date BETWEEN '2003-01-01' AND '2003-01-07'; -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "A new commandment I give to you, that you love one another, even as I have loved you." John 13:34