Re: casting for dates

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: Andrew McMillan <andrew(at)catalyst(dot)net(dot)nz>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: casting for dates
Date: 2001-09-26 21:19:27
Message-ID: Pine.BSF.4.30.0109261719080.55979-100000@paprika.michvhf.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(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
==========================================================================

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Myron Scott 2001-09-26 22:03:00 Re: Spinlock performance improvement proposal
Previous Message Tom Lane 2001-09-26 21:17:12 Re: Spinlock performance improvement proposal