470,815 Members | 1,123 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,815 developers. It's quick & easy.

Number of months

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)

Patrick Hatcher

Nov 23 '05 #1
0 1721

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Christopher Benson-Manica | last post: by
3 posts views Thread by MMFBprez | last post: by
7 posts views Thread by developer | last post: by
2 posts views Thread by Patrick Hatcher | last post: by
37 posts views Thread by Gregc. | last post: by
16 posts views Thread by some old html fumbler | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.