Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Calculate Duration in years
Message
 
To
22/03/1999 12:25:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00200532
Message ID:
00200558
Views:
10
Hi Erik,

>I have the need to calculate the timespan in years between 2 dates. Getting the number of days between is no problem; figuring out how many years 1426 days is is another question. I am able to get fairly close using days/365.25 but I don't think this is going to cut it. I am aware of the financial terms 30/360 and Actual/Actual, but don't know how to use these methods to calculate duration. Anybody have a clue?

What is a duration of a year for you? From December to January, does that make a year, or is it 2 month (=1/6 year)? One possibility would be:

(12*YEAR(date2)+MONTH(date2)-12*YEAR(date1)+MONTH(date1)+1) / 12

Christof
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform