* 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 ldbefore = CTOD(ALLTRIM(STR(MONTH(ldearly))) + "/" +; ALLTRIM(STR(DAY(ldearly))) + "/" + ; ALLTRIM(STR(YEAR(ldlate)))) pnyears = YEAR(ldlate) - YEAR(ldearly) 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 * This is the modification IF GOMONTH(ldnewdate, pnmonths) > ldlate pnmonths = pnmonths - 1 ENDIF ldnewdate = GOMONTH(ldnewdate, pnmonths) pndays = ldlate - ldnewdate RETURNHow's that? It's worked with everything I've tested. Let me know if you can manage to find a flaw.< g >