From: | Wim Kerkhoff <wim(at)netmaster(dot)ca> |
---|---|
To: | Aaron Seigo <aaron(at)gtv(dot)ca> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: [GENERAL] Selecting between dates |
Date: | 1999-08-10 15:49:31 |
Message-ID: | XFMail.990810154931.wim@netmaster.ca |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)netmaster(dot)ca
www.canadianhomes.net/wim
ICQ: 23284586
From | Date | Subject | |
---|---|---|---|
Next Message | Dmitry Morozovsky | 1999-08-10 17:30:31 | repost: unique composite index with boolean fields |
Previous Message | Wim Kerkhoff | 1999-08-10 14:57:36 | Selecting between dates |