Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is best way to calculate age
Message
 
 
To
21/09/2006 09:47:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01155605
Message ID:
01155967
Views:
28
>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
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform