Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DateDiff
Message
From
22/02/2001 05:40:16
 
 
To
22/02/2001 05:38:46
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00478312
Message ID:
00478320
Views:
21
>>I need to write a DateDiff function for differences in Months, the closest I can come to is:
>>
>>INT((tdEndDate-tdStartDate)/30)
>>
>>Which is a bit assumptious, I understand that there is a long way of doing this by checking which 2 months you are comparing and altering the figures accordingly, but I was wondering if there was a straight forward way of doing it.
>>
>>Thanks
>>Kev
>
>By differences in months do you mean...
>15 Jan 2000 - 30 Mar 2000 = 3 months?
>
>If so then
>? month(tdEndsate) - month(tdEnddate)
>
>HTH
>
>Will

BUT... I forgot about years...

If this func spans a year boundary then it does not work...

I am sure I have seen a similar thread a few months ago.

Will
Will Jones
Previous
Reply
Map
View

Click here to load this message in the networking platform