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 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.
> --
> ==========================================================================
> Vince Vielhaber -- KA8CSH    email: [EMAIL PROTECTED]    http://www.pop4.net
>          56K Nationwide Dialup from $16.00/mo at Pop4 Networking
>         Online Campground Directory    http://www.camping-usa.com
>        Online Giftshop Superstore    http://www.cloudninegifts.com
> ==========================================================================
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
>


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to