Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get the number of months between 2 dates ?
Message
 
 
To
25/11/1999 10:46:17
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00295544
Message ID:
00295554
Views:
24
>>nMonths = (year(dDate2)*12 + month(ddate2)) - (year(dDate1)*12 + month(dDate1)) + 1

>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).

The calculate at the top works for that case try it out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform