>Thanks Rich! It has helped me. Now I have another query. How I can replace the results in a dbf? I failed to do so. The variable for days is somehow difficult to me.
>
CAST() is a VFP9's function.
SET DATE DMY
date1=DATE(2005,12,12)
date2=DATE(2006,6,21)
mdiff =((YEAR(date2)-YEAR(date1))*12+MONTH(date2)-MONTH(date1)) % 12
dDiff = date2 - GOMONTH(date1,mdiff)
CLEAR
? mdiff,dDiff