Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compute how many years,months,days
Message
De
28/10/2004 06:16:51
 
 
À
28/10/2004 05:40:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 5
Divers
Thread ID:
00955191
Message ID:
00955196
Vues:
20
try with this procedure, but I haven't tested well so... :.)

procedure getYearMonthDay

Parameters a,b
*-- a = first date
*-- b = last date

NumYear = Year(b)-Year(a)
NumMonth = Month(b)-Month(a)
NumDay = Day(b) - Day(a)

If NumDay < 0
NumMonth = NumMonth - 1
Numday = (Gomonth(a,1)-Day(Gomonth(a,1)) - a )+ Day(b)
EndIf
If NumMonth < 0
NmYear = NumYear - 1
NumMonthi = Abs(NumMonth)
EndIf

? NumYear, NumMonth, NumDay

HTH
Alessio


>hi all,
>
>how i can compute at myform as ,
>i want to insert at (thisform.text1.value...DATE("1963/03/29"))
>(thisform.text2.value...DATE("2004/10/25"))
>
>result at thisform.text3.value=39 years
> thisform.text4.value=9 months
> thisform.text5.value=25 days
> or
>at thisform.text3.value=
> ex.. 39 9 25
>
>thanks.
>m.qasem year
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform