>Does someone have a routine that calculates someones's age based upon the current date?
>
>I have written one, but it does not account for leap years so it's basically useless and I don't want to reinvent the wheel. It's probably a common routine out there.
The easy way:
FUNCTION AGE
LPARAMETER dBirth, dWhen
LOCAL nYears
nYears = YEAR(dWhen) - YEAR(dBirth)
IF GOMONTH(dBirth, 12*nYears)>dWhen
nYears = nYears-1
ENDIF
RETURN nYears
HTH!