Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A twist on age calculation.
Message
De
31/12/2004 08:32:13
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
31/12/2004 08:04:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
00973330
Message ID:
00973518
Vues:
26
>Cetin,
>
>>Jim,
>>Main problem I think in your routine you're using highly randomized values for days that doesn't fit well saying time difference in YMD.
>>ie: dod is {^2002/07/21}, died 1 year, 8 months, 328 days ago. dobs then {^1999/12/27}
>>It's also same as saying died 2 years, 6 months, 24 days ago.
>
>My data comes from an effective 'day' counter, not unlike an operating system uptime value. My problem is finding that last reboot ;-)
>
>>ndys = min(INT(31 * RAND() + 1), day(ddod))
>>
>>should almost get the differences to 0 (still might be as difference saying could be like:
>>2 years 2 months 31 days vs 2 years 3 months 0 days).
>>PS: Check my first reply. It was updated for a slight adjustment in CalcBdate.
>>Cetin
>
>Got the change, thanks. Now we are at about 850 good results in the 1000 samples, with the remaining differences maxing at around 3 days. I think I can live with this. Thanks much!

You're welcome and happy new year. Your problem leaded me to notice flaws in my routines:) I'll correct them in the future I think.
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
Répondre
Fil
Voir

Click here to load this message in the networking platform