Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calculate Duration in years
Message
 
À
22/03/1999 12:25:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00200532
Message ID:
00200558
Vues:
9
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform