Re: [GENERAL] Selecting between dates - Mailing list pgsql-general

From Wim Kerkhoff
Subject Re: [GENERAL] Selecting between dates
Date
Msg-id XFMail.990810154931.wim@netmaster.ca
Whole thread Raw
In response to Re: [GENERAL] Selecting between dates  (Aaron Seigo <aaron@gtv.ca>)
List pgsql-general
Thanks Aaron,

That is exactly what I wanted.  Much more simple then what I was thinking.


On 10-Aug-99 Aaron Seigo wrote:
> hi wim..
>
>>select * from company where created
>>is between (lastpaid + 14 days) and (created + 28 days);
>
> assuming that lastpaid and created are dates, pgsql will handle the
> addition quite nicely for you... as examples:
>
> test=> select '4-1-1999'::date + 7;
>   ?column?
> ----------
> 04-08-1999
> (1 row)
>
> test=> select '4-26-1999'::date + 7;
>   ?column?
> ----------
> 05-03-1999
>
> test=> select '12-26-1999'::date + 7;
>   ?column?
> ----------
> 01-02-2000
> (1 row)
>

Regards,
---------------------------
 Wim Kerkhoff
 wim@netmaster.ca
 www.canadianhomes.net/wim
 ICQ: 23284586

pgsql-general by date:

Previous
From: Aaron Seigo
Date:
Subject: Re: [GENERAL] Selecting between dates
Next
From: Mike Mascari
Date:
Subject: Re: [GENERAL] anomalous, persistent high loads with postgresql 6.5.1