Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What is best way to calculate age
Message
 
 
To
21/09/2006 11:42:42
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:
01156040
Views:
39
>>>? GOMONTH(DATE()-22,-6-18*12)
>>>
>>>Cetin
>>
>>* 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)
>> ? GOMONTH(DATE()- .Days,-.Months-.Years*12)
>
>Why don't you check your correct definition:
>? GOMONTH({^1988/2/29},18*12+6)+22
>? GOMONTH(GOMONTH({^1988/2/29},18*12),6)+22
>Why are they different?
>For another sample explain this:
>
? Gomonth(GOMONTH(GOMONTH({^1988/2/29},13),-1),1)
>
>I see that you want to play gomonth() tricks on me:) One you claimed to be a bad definition has the answer already, no?
>Cetin

I can explain your last sample
and also have another funny one
?Gomonth(GOMONTH(GOMONTH({^1988/2/29},13),-1),-12)

I can also explain your other two why they are different.
?(18*12+6)/4
?(18*12)/4

I guess you're right and we just have to stick to some definition...
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform