Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Age Calculation
Message
De
11/04/2000 15:21:04
 
 
À
11/04/2000 10:46:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00358037
Message ID:
00358284
Vues:
10
>I have the date of birth for a client.
>
>I need a function that tells me how old the client was on a certain date.
>
>For example, if the dob was 01/01/1970, how old was the client on 01/10/1985?
>
>Does anyone know of a way of doing this in VFP?
>
>Thanks
>Kev

This is a quick example of what I use.


ThisForm.lblage.caption = ovars.agecalc(player.dob)

***********
*** AgeCalc Method
Parameter lzddob

DO CASE

CASE VarType(lzddob)#[D]
RETURN 0
CASE EMPTY(lzddob)
RETURN 0

OtherWise
FOR i = 1 to 99999

IF DATE()<= GOMONTH(lzddob,i*12)
Exit
EndIF
EndFor
RETURN i
EndCase
Fred Lauckner

You know, it works on my computer. I don't know what your problem is.

.Net aint so bad.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform