Re: to_char(interval) --- done?
От | Larry Rosenman |
---|---|
Тема | Re: to_char(interval) --- done? |
Дата | |
Msg-id | 103270000.1048698403@lerlaptop.iadfw.net обсуждение исходный текст |
Ответ на | Re: to_char(interval) --- done? (Josh Berkus <josh@agliodbs.com>) |
Ответы |
Re: to_char(interval) --- done?
|
Список | pgsql-hackers |
--On Wednesday, March 26, 2003 08:50:36 -0800 Josh Berkus <josh@agliodbs.com> wrote: > 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 ... I needed like 5 years (60 months)... So, the wrap around is not good in this case. Thanks, though. > > -- > Josh Berkus > Aglio Database Solutions > San Francisco -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
В списке pgsql-hackers по дате отправления: