* CalcAge LPARAMETERS pdBirth LOCAL lcRet, ldDate, lnYears, lnMonths, lnDays, ldLastDate STORE 0 TO lnYears, lnMonths, lnDays lcRet = "" ldDate = pdDate DO WHILE ldDate < DATE() lnMonths = lnMonths + 1 ldLastDate = ldDate ldDate = GOMONTH(ldDate,1) ENDDO ldDate = ldLastDate lnYears = IIF(lnMonths>=12,lnMonths/12,0) lnMonths = lnMonths%12 lnDays = DATE() - ldDate DO CASE CASE lnYears > 0 lcRet = ALLTRIM(STR(lnYears)) + " Year" + ; IIF(lnYears=1," ","s ") + ; ALLTRIM(STR(lnMonths)) + " Month" + ; IIF(lnMonths=1," ","s ") + ; ALLTRIM(STR(lnDays)) + " Day" + ; IIF(lnDays=1,"","s") CASE lnMonths > 0 lcRet = "0 Years " + ; ALLTRIM(STR(lnMonths)) + " Month" + ; IIF(lnMonths=1," ","s ") + ; ALLTRIM(STR(lnDays)) + " Day" + ; IIF(lnDays=1,"","s") OTHERWISE lcRet = "0 Years 0 Months" + ; ALLTRIM(STR(lnDays)) + " Day" + ; IIF(lnDays=1,"","s") ENDCASE RETURN lcRet