Re: to_char(interval) --- done? - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: to_char(interval) --- done?
Date
Msg-id 200303260850.36232.josh@agliodbs.com
Whole thread Raw
In response to Re: to_char(interval) --- done?  (Larry Rosenman <ler@lerctr.org>)
Responses Re: to_char(interval) --- done?  (Larry Rosenman <ler@lerctr.org>)
List pgsql-hackers
Larry,

> I had a need that should(!) be in the archives.  Just to reiterate my need:
>
> I input a contract length, in months, and wanted to get it back out as
> months.  There is no current way to do this, so I store it as an INT and
> concatenate the word months to do the
> date arithmetic.

What about EXTRACT(months FROM <interval_field>)?

This annoyingly wraps around if it's more than 12 months, but that was part of
my proposal ...

--
Josh Berkus
Aglio Database Solutions
San Francisco



pgsql-hackers by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: to_char(interval) --- done?
Next
From: Larry Rosenman
Date:
Subject: Re: to_char(interval) --- done?