I need to calculate the number of full months between two dates. For example, 11/1/07 and 2/29/08. I need the number of full months between these two dates to show as 4. Using the standard datediff formula only shows 3 months.
I also tried the following formula that I found online:
Datediff(mm, 0, Dateadd(dd, Datediff(dd, 0, @EndDate)-Datediff(dd, 0, @BeginDate), 0))
This works most of the time, but when I try to get the difference between 11/1/07 and 6/30/08, it returns 7 instead of 8.
What am I missing?
I also tried the following formula that I found online:
Datediff(mm, 0, Dateadd(dd, Datediff(dd, 0, @EndDate)-Datediff(dd, 0, @BeginDate), 0))
This works most of the time, but when I try to get the difference between 11/1/07 and 6/30/08, it returns 7 instead of 8.
What am I missing?