Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Coding puzzle 2
Message
From
04/06/2002 14:05:23
 
 
To
04/06/2002 13:53:06
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00664570
Message ID:
00664637
Views:
15
Mike,

No...try this:
TDD = {^2003-01-16}
TDB = {^2001-01-16}
? INT((tdD-tdB)/365.25)   && shows 1 year
TDB = {^2000-01-16}
? INT((tdD-tdB)/365.25)   && shows 3 years
Is the second person 2 years older than the first? *grin*

Dividing days by 365.25 is not a reliable method of calculating years...

>You mean if the child isn't 1 yet? I'd call that 0 years ;) My code was *designed* that way ;)
>
>>Mike,
>>
>>This method fails for young people on their birthday. There may be other scenarios that will give incorrect results also...
>>
Steve Gibson
Previous
Reply
Map
View

Click here to load this message in the networking platform