Re: Convert INT to INTERVAL? - Mailing list pgsql-sql

From Michael Chaney
Subject Re: Convert INT to INTERVAL?
Date
Msg-id 20040227180705.GC8807@michaelchaney.com
Whole thread Raw
In response to Convert INT to INTERVAL?  (Brian Knox <laotse@aol.net>)
List 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@michaelchaney.com
http://www.michaelchaney.com/


pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Convert INT to INTERVAL?
Next
From: Tom Lane
Date:
Subject: Re: Convert INT to INTERVAL?