Hi Evan,
>>How to get the number of months when date1 is substracted from date2?
>
>First of all it depends on what you mean by month.
>
>1) 30 days
>
>nMonths = (dDate2 - dDate1 )/30
>
>2) 28 days
>
>nMonths = (dDate2 - dDate1)/28
>
>3)Or you could calculate something like this. If someone were to ask how many calendar months have you been in business. Example: if you started your business on Jan 15 and it was now Feb 8. You might respond, I have been in business 2 months (Jan and Feb)
>
>nMonths = (year(dDate2)*12 + month(ddate2)) - (year(dDate1)*12 + month(dDate1)) + 1
>
>What is it that you are trying to calculate?
Let me give you an example. (a date always have to be the first of a given month)
So if:
Date1 is April 2000
Date2 is May 1999
I would like in this case to be able to validate that the specified period covers one year (12 months).
*******************************************************
Save a tree, eat a beaver.
Denis Chassé