pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Richard Huxton <dev@archonet.com>
Cc: mixo <mixo@beth.uniforum.org.za>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: two dates
Date: 03 Mar 2003 12:32:44 +0000
Message-ID: <1046694764.2173.132.camel@linda.lfix.co.uk> (raw)
In-Reply-To: <200303031209.36970.dev@archonet.com>
References: <3E5B1349.80705@beth.uniforum.org.za>
	<200303031209.36970.dev@archonet.com>

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




view thread (4+ messages)  latest in thread

Message-ID: <1046694764.2173.132.camel@linda.lfix.co.uk>
Permalink:  ../1046694764.2173.132.camel@linda.lfix.co.uk/
Also on:    postgresql.org/message-id/1046694764.2173.132.camel@linda.lfix.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: olly@lfix.co.uk, dev@archonet.com, mixo@beth.uniforum.org.za
  Subject: Re: two dates
  In-Reply-To: <1046694764.2173.132.camel@linda.lfix.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox