Re: two dates - Mailing list pgsql-sql

From Oliver Elphick
Subject Re: two dates
Date
Msg-id 1046694764.2173.132.camel@linda.lfix.co.uk
Whole thread Raw
In response to Re: two dates  (Richard Huxton <dev@archonet.com>)
List pgsql-sql
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
haveloved you."                                       John 13:34
 



pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: two dates
Next
From: Tomasz Myrta
Date:
Subject: Re: pl/pgsql errors