Re: [HACKERS] casting for dates

2001-09-26 Thread Vince Vielhaber
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

Re: [HACKERS] casting for dates

2001-09-26 Thread Vince Vielhaber
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

Re: [HACKERS] casting for dates

2001-09-26 Thread Ryan Mahoney
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

Re: [HACKERS] casting for dates

2001-09-26 Thread Mitch Vincent
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

Re: [HACKERS] casting for dates

2001-09-26 Thread Andrew McMillan
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?

[HACKERS] casting for dates

2001-09-26 Thread Vince Vielhaber
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. -- ==