Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Month Calculations
Message
 
To
20/04/2001 19:10:44
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00498208
Message ID:
00498230
Views:
14
Larry,

When you're working with whole months the GoMonth() function in a "Do While" loop works great. If your dates aren't exactly a month apart you can still use GoMonth() and simply include (or exclude depending on your app) portions of months.

HTH
Barbara

>We need to determine exactly how many months difference there is between 2 dates in VFP
>Example:
>01/01/2001 - 03/01/2001 = 3 months
>
>We are currently trying the following:
>x=date1 (01/01/2001)
>y=date2 (03/01/2001)
>z=y - x
>b=z/365*12
>c=b +1
>
>result=int(c)
>
>The problem we are running into is short months
>
>
>Larry
Barbara Paltiel, Paltiel Inc.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform