Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A twist on age calculation.
Message
 
 
À
30/12/2004 14:02:34
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:
00973371
Vues:
27
>I'm assuming you are using your class to check, right? I am. I've found several other docs that allow some cross checking and I'm also seeing the slight variance. If you have the perfect solution, I'll be glad to use it. Right now, the +/- 1 day variance is the worse I've seen, and is acceptable for our purposes. Luckily, no 2/29 dates in the data ;-)

Like I said, it just depends on how accurate you want to be. GOMONTH can change the day of the month when beginning from a date with a day of 29, 30, or 31. To be fully accurate you need to adjust for this.

I used my class to run some examples here, but the results can be derived and checked easily enough by hand. For example, 09/13/1868 plus 33 years = 09/13/1901, plus 6 months = 03/13/1902, plus 18 days = 03/31/1902. If you start with 09/12/1868 you end up with 03/30/1902.

If you can live with a little variance in the result then certainly the simpler solutions are okay, though.
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform