Number of months

Поиск
Список
Период
Сортировка
От Patrick Hatcher
Тема Number of months
Дата
Msg-id OFF980F669.F075E431-ON88256F41.0063B840-88256F41.0068E77D@fds.com
обсуждение исходный текст
Ответы Re: Number of months  (Franco Bruno Borghesi <franco@akyasociados.com.ar>)
Список pgsql-general

Is there a function that will give me the  number of months, as an integer, in Pg 7.4.x?  I found the date_trunc function but that will return text and I didn't see anything else?

I have this, but didn't want to duplicate the work if it wasn't necessary:

(date_part('Year', CURRENT_DATE) -date_part('Year', SOMEDATE)) * 12 +date_part('Month', CURRENT_DATE)-date_part('Month',SOMEDATE)

TIA

Patrick Hatcher


В списке pgsql-general по дате отправления:

Предыдущее
От: Reynard Hilman
Дата:
Сообщение: pg_xlog
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_xlog