Re: casting for dates

From: "Mitch Vincent" <mvincent(at)cablespeed(dot)com>
To: "Vince Vielhaber" <vev(at)michvhf(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: casting for dates
Date: 2001-09-26 20:52:16
Message-ID: 005501c146cd$25e4b4b0$1e51000a@mitch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Will

SELECT now() - 'nummonths months'::interval ;

work?

----- Original Message -----
From: "Vince Vielhaber" <vev(at)michvhf(dot)com>
To: <pgsql-hackers(at)postgresql(dot)org>
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: vev(at)michvhf(dot)com 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 majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Padgett 2001-09-26 20:53:08 Re: Spinlock performance improvement proposal
Previous Message mlw 2001-09-26 20:43:02 Re: Spinlock performance improvement proposal