Number of months - Mailing list pgsql-general

From Patrick Hatcher
Subject Number of months
Date
Msg-id OFF980F669.F075E431-ON88256F41.0063B840-88256F41.0068E77D@fds.com
Whole thread Raw
Responses Re: Number of months
List 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 by date:

Previous
From: Reynard Hilman
Date:
Subject: pg_xlog
Next
From: Bruce Momjian
Date:
Subject: Re: pg_xlog