date ranges in where

From: Miguel Miranda <miguel(dot)mirandag(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: date ranges in where
Date: 2009-05-06 21:12:47
Message-ID: aa6b08350905061412x63defb39oe58e126510354a28@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, what is the recommended way to select a range of dates?

Lets say a have a table with a lastlogin (timestamp) column and i want
toknow what users logged in for last time between 2009-05-01 and 2009-05-02?

I know that a simple

where lastlogin between '2009-05-01' and '2009-05-02' doesnt work beacuse it
doesnt include who logged in 2009-05-02 15:30:00, etc...

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric Schwarzenbach 2009-05-06 21:16:37 Re: XML -> PG ?
Previous Message Tom Lane 2009-05-06 21:11:38 Re: [GENERAL] how to select temp table