Re: Re: Incrementing a date type.

From: will trillich <will(at)serensoft(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Bruno Wolff III <bruno(at)wolff(dot)to>, DC <danc(at)bspmail(dot)com>
Subject: Re: Re: Incrementing a date type.
Date: 2001-06-02 12:11:29
Message-ID: 20010602071129.E28201@serensoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, May 23, 2001 at 08:59:00AM -0500, Bruno Wolff III wrote:
> On Fri, May 18, 2001 at 12:17:47PM -0500,
> DC <danc(at)bspmail(dot)com> wrote:
> > I have an event that is three days long. In a table I want to be able to
> > enter Friday date and have Saturdays and Sundays fill in automatically. It
> > also has to check for the month/# of days in...
>
> You can add intervals to timestamps. If you use an interval of 1 day, this will
> probably do what you want.

for example --

select 'april 19, 2001'::date + interval('2 week');

or, just for confusion,

select date('april 19, 2001') + '2 week'::interval;

check the docs on what keywords are acceptable intervals. it's
wonderful.

--
#95: We are waking up and linking to each other. We are watching. But
we are not waiting. -- www.cluetrain.com

will(at)serensoft(dot)com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Frank 2001-06-02 12:13:57 about PostgreSQL...(important)
Previous Message will trillich 2001-06-02 12:07:05 Re: Re: Cant get Perl Module loaded