get number of full calendar months between 2 dates

get number of full calendar months between 2 dates

Hi,

working further on my project lined out in a previous post - here's another pickle:

I have two dates set, a beginning date and an end date for a period of time. That period can span several years.

I now need to calculate the months in that period in accordance with the following reasoning:

example:
date1 = february 2, 2010
date2 = december 30, 2010

-> fullmonths = 9 (march, april, may, june, july, august, september, october, november)
restBeginMonth = (28-2+1)/28 = 27/28 = 0,964
restEndMonth =30/31 = 0.968
=> totalMonths = fullmonths+ restBeginMonth + restEndMonth= 10.932 months

My trouble here is that I can't seem to figure out how to calculate the number of FULL calendar months in the range...

cheers
Greg