>No, let's say that your data starts January 1, 2011, and ends on March 17, 2011. We both know that this covers January, Febraury adn March, so it's three months.
>
>So, if you had :
>
>StartDate = DATE(2011,01,01)
>EndDate = DATE(2010,03,17)
>?MONTH(EndDate)-MONTH(StartDate)
>
>it would only show a value of 2, meaning two months, but it actually covered a partial month for a 3rd month.
My question was a bit more complex, say,
Your start date is Jan. 20 and end date is March 20. How many months?
I was thinking you can do
select count(month(Date))
group by month(date)
to get the number of months (even partial months).
If it's not broken, fix it until it is.
My Blog