Re: casting for dates - Mailing list pgsql-hackers

From Vince Vielhaber
Subject Re: casting for dates
Date
Msg-id Pine.BSF.4.30.0109261719080.55979-100000@paprika.michvhf.com
Whole thread Raw
In response to Re: casting for dates  (Andrew McMillan <andrew@catalyst.net.nz>)
List pgsql-hackers
On 27 Sep 2001, Andrew McMillan wrote:

> On Thu, 2001-09-27 at 08:30, Vince Vielhaber wrote:
> >
> > I'm trying to use an integer from a table to add/subtract time in months.
> > IOW:
> >
> > create table foo(nummonths int);
> >
> > select now() - nummonths months;
>
> newsroom=# select now() - interval( text(3) || ' months');
>         ?column?
> ------------------------
>  2001-06-27 08:56:27+12
> (1 row)
>
>
> Crude, but hey: it works :-)

It certainly does!  Thanks!

Vince.
-- 
==========================================================================
Vince Vielhaber -- KA8CSH    email: vev@michvhf.com    http://www.pop4.net        56K Nationwide Dialup from $16.00/mo
atPop4 Networking       Online Campground Directory    http://www.camping-usa.com      Online Giftshop Superstore
http://www.cloudninegifts.com
==========================================================================





pgsql-hackers by date:

Previous
From: "D. Hageman"
Date:
Subject: Re: Spinlock performance improvement proposal
Next
From: Ian Lance Taylor
Date:
Subject: Re: Spinlock performance improvement proposal