Re: to_char(interval) --- done?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Larry Rosenman <ler(at)lerctr(dot)org>, Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org, Peter Eisentraut <peter_e(at)gmx(dot)net>
Subject: Re: to_char(interval) --- done?
Date: 2003-03-26 16:50:36
Message-ID: 200303260850.36232.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Larry Rosenman 2003-03-26 17:06:43 Re: to_char(interval) --- done?
Previous Message Larry Rosenman 2003-03-26 16:46:30 Re: to_char(interval) --- done?