Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to group this?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00460146
Message ID:
00496777
Vues:
8
Barbara,
What formula did you use to calculate age? I'm actually trying to calculate age for a given date of service and I come up with incorrect age calculations due to leap years. E.g. INT({^2001/03/04} -{1968/03/05}/365.25) correctly calculates the service date age at 32, however, INT({^2001/03/05} -{1968/03/05}/365.25) incorrectly shows as 32. Can't use rounding b/c the day prior to the birthday would incorrectly show as 33. I have emperically tested different combinations of leap year/non-leap year for every month and correction factors are needed for about 25% of the combinations. It sure would be nice to clean up that code.

TIA
JR

>John,
>Add a field to the SELECT that contains int(age/10)*10. This will give you the number of complete decades (if the person is 30-39 it'll show '30', etc.).
>
>HTH
>Barbara
>
>>Hi,
>> I have member.birthday field in my table. I get the formula to calculate members' age. How should I group them base on their age such as 10, 20, 30, and ...?
>>
>>Thank you
CLARC Services, Inc.
3500 Tamiami Trail
Port Charlotte, FL 33952
www.clarc.com
(941) 743-0108
(800) 246-5488
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform