Re: Re: Incrementing a date type. - Mailing list pgsql-general

From will trillich
Subject Re: Re: Incrementing a date type.
Date
Msg-id 20010602071129.E28201@serensoft.com
Whole thread Raw
In response to Re: Incrementing a date type.  (Bruno Wolff III <bruno@wolff.to>)
List 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@bspmail.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@serensoft.com
http://sourceforge.net/projects/newbiedoc -- we need your brain!
http://www.dontUthink.com/ -- your brain needs us!

pgsql-general by date:

Previous
From: will trillich
Date:
Subject: Re: Re: Cant get Perl Module loaded
Next
From: will trillich
Date:
Subject: Re: Am I headed in the right direction? (long)