I need to print the number of months between 2 dates. The best (easy)
solution I could come up with was the approximation int( (days(end_date)
- days(begin_date) / (365.24/12)) which is accurate enough for most
uses, but I wondered if there were a "monthsdiff( date1, date2)"
somewhere in the documentation I haven't found, probably by another name?
Have you considered:
months_between = year(end)*12+month(end) - (year(start)*12+month(start))
Bob Stearns wrote:
I need to print the number of months between 2 dates. The best (easy) solution I could come up with was the approximation int( (days(end_date) - days(begin_date) / (365.24/12)) which is accurate enough for most uses, but I wondered if there were a "monthsdiff( date1, date2)" somewhere in the documentation I haven't found, probably by another name?
Have you considered: months_between = year(end)*12+month(end) - (year(start)*12+month(start))
Bob Stearns wrote:
I need to print the number of months between 2 dates. The best (easy) solution I could come up with was the approximation int( (days(end_date) - days(begin_date) / (365.24/12)) which is accurate enough for most uses, but I wondered if there were a "monthsdiff( date1, date2)" somewhere in the documentation I haven't found, probably by another name?
I had not; probably a senior moment :-). Thank you.