* FUNCTION YrsMosDays.prg LPARAMETERS pddate1, pddate2, pnyears, pnmonths, pndays LOCAL ldearly, ldlate, ldbefore, lnyears, ldnewdate ldearly = MIN(pddate1, pddate2) ldlate = MAX(pddate1, pddate2) * Create a date made of the later year and * the month and day of the earlier date pnyears = 0 DO WHILE YEAR(GOMONTH(ldearly, pnyears * 12)) < YEAR(ldlate) pnyears = pnyears + 1 ENDDO ldbefore = GOMONTH(ldearly, pnyears * 12) IF ldbefore > ldlate pnyears = pnyears - 1 ENDIF ldnewdate = GOMONTH(ldearly, pnyears * 12) pnmonths = MONTH(ldlate) - MONTH(ldnewdate) IF pnmonths < 0 pnmonths = pnmonths + 12 ELSE IF ldbefore > ldlate AND pnmonths = 0 pnmonths = 11 ENDIF ENDIF IF GOMONTH(ldnewdate, pnmonths) > ldlate pnmonths = pnmonths - 1 ENDIF ldnewdate = GOMONTH(ldnewdate, pnmonths) pndays = ldlate - ldnewdate RETURNI know some of the above will look familiar (referencing your other post).< g >