That may not produce the expected results you may be looking for.
One thing to be aware of here:
The DateDiff shows in this case month
intervals passed, and not months passed.
Roughly, 180 days is six months. From 31 Jan, 31 July would be 182 days.
Using DateDiff("m",#2008-1-31#,#2008-7-1#) you will get a result of 6 months, but actually it is only 152 days (5 months and 1 day).
?DateDiff("m",#1/31/2008#,#7/1/2008#) > =6
True
?DateDiff("d",#1/31/2008#,#7/1/2008#)
152
It is even more evident with this:
?DateDiff("m",#1/31/2008#,#2/1/2008#)
Even though only one day has past, the result is 1 month (interval)
I don't know if this applies to what you are looking for, but it may be relevant to it.
To adjust for this you can do something like this:
Code:
Public Function IsEndDateOver(StartDate As Date, EndDate As Date, Months As Integer) As Boolean
IsEndDateOver = EndDate >= DateAdd("m", Months, StartDate)
End Function
?IsEndDateOver(#1/31/2008#,#7/1/2008#,6)
False
?IsEndDateOver(#1/31/2008#,#7/30/2008#,6)
False
?IsEndDateOver(#1/31/2008#,#7/31/2008#,6)
True
?IsEndDateOver(#1/31/2008#,#2/1/2008#,1)
False
?IsEndDateOver(#1/31/2008#,#2/29/2008#,1)
True
This last one produces True. One month has passed, but not 30 days. If you expect it to return Faslse, then that is again a different logic where you would probably need to always define a month as 30 days.