Months Between Dates

Months Between Dates

I am trying to create a function to calculate the number of months between two dates.  I was using the getmonth function to calculate this based upon the month of the year; however this logic breaks down when the months cross years.

For example:

Start Date:November 2, 2009

End Date: January, 10, 2010

Number of months:3

Thanks!