Skip site navigation (1) Skip section navigation (2)

casting for dates

From: Vince Vielhaber <vev(at)michvhf(dot)com>
To: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: casting for dates
Date: 2001-09-26 20:30:52
Message-ID: Pine.BSF.4.30.0109261627240.55979-100000@paprika.michvhf.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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
==========================================================================




Responses

pgsql-hackers by date

Next:From: Mike RogersDate: 2001-09-26 20:42:45
Subject: Re: PostgreSQL / PHP Overrun Error
Previous:From: Bruce MomjianDate: 2001-09-26 20:22:06
Subject: Re: Problem with setlocale (found in libecpg) [accessing a

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group