Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Age Calculation
Message
From
11/04/2000 15:21:04
 
 
To
11/04/2000 10:46:10
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00358037
Message ID:
00358284
Views:
9
>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.
Previous
Reply
Map
View

Click here to load this message in the networking platform