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: (view raw or whole thread)
Lists: pgsql-hackers
I'm trying to use an integer from a table to add/subtract time in months.

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 Vielhaber -- KA8CSH    email: vev(at)michvhf(dot)com
         56K Nationwide Dialup from $16.00/mo at Pop4 Networking
        Online Campground Directory
       Online Giftshop Superstore


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-2015 The PostgreSQL Global Development Group