Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is best way to calculate age
Message
De
21/09/2006 10:47:54
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01155605
Message ID:
01155997
Vues:
35
>>No problem and I don't care if you use or not. Woould you tell me what do you mean by "since this class returns an incorrect result"?
>>Cetin
>
>
>WITH CREATEOBJECT("age")
>
>	.CalcAge({^1988/2/29} ,  {^2006/09/21 })
>
>	CLEAR
>	
>	? .Years , .Months , .Days
>	* CHECK with the correct definition Age = (((Birth+Y)+M)+D)
>	?  GOMONTH(GOMONTH({^1988/2/29},.Years*12),.Months)+.Days
>	* CHECK with a bad definition
>	?  GOMONTH({^1988/2/29},.Years*12+.Months) + .Days
>	?  gomonth(GOMONTH({^2006/09/21} - .Days, - .Months), - .Years *12)
>ENDWITH
18 years, 6 months and 22 days. Correct. I don't understand why you say it's a bad definition. Use pen and pencil.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform