--On Wednesday, March 26, 2003 08:50:36 -0800 Josh Berkus
>> I had a need that should(!) be in the archives. Just to reiterate my
>> 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 ...
I needed like 5 years (60 months)...
So, the wrap around is not good in this case.
> Josh Berkus
> Aglio Database Solutions
> San Francisco
Larry Rosenman http://www.lerctr.org/~ler
Phone: +1 972-414-9812 E-Mail: ler(at)lerctr(dot)org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
In response to
pgsql-hackers by date
|Next:||From: opensource||Date: 2003-03-26 17:49:03|
|Subject: Win32 Postgresql version.|
|Previous:||From: Josh Berkus||Date: 2003-03-26 16:50:36|
|Subject: Re: to_char(interval) --- done?|