On Wed, 26 Sep 2001, Mitch Vincent wrote:
> Will
>
> SELECT now() - 'nummonths months'::interval ;
>
> work?
Unfortunately no.
Vince.
--
==
Vince Vielhaber -- KA8CSHemail: [EMAIL PROTECTED]http://www.pop4.net
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() - i
Haven't tried yet, but perhaps casting nummonths to an interval datatype
would do the trick.
-r
At 04:30 PM 9/26/01 -0400, 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 mo
Will
SELECT now() - 'nummonths months'::interval ;
work?
- Original Message -
From: "Vince Vielhaber" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 4:30 PM
Subject: [HACKERS] casting for dates
>
> I'm t
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?
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;
So far nothing I've tried will work - short of a function. Is there a
way to do this?
Vince.
--
==