Re: Convert INT to INTERVAL?

From: Michael Chaney <mdchaney(at)michaelchaney(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Convert INT to INTERVAL?
Date: 2004-02-27 18:07:05
Message-ID: 20040227180705.GC8807@michaelchaney.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Fri, Feb 27, 2004 at 11:54:04AM -0500, Brian Knox wrote:
> Is it possible within pl/pgsql, to convert an integer to an interval in
> months? IE, if num_months is an INT set to 48, can it be converted to an
> interval?

select (1||' months')::interval;

You should be able to replace the "1" with your integer variable.

Michael
--
Michael Darrin Chaney
mdchaney(at)michaelchaney(dot)com
http://www.michaelchaney.com/

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2004-02-27 18:12:17 Re: Convert INT to INTERVAL?
Previous Message Bruno Wolff III 2004-02-27 17:40:59 Re: Convert INT to INTERVAL?