Procedure cntmonths(ts,te) Local lnMonths, ix, ldNext lnMonths = 0 For ix=0 To m.te-m.ts lnMonths = m.lnMonths + 1 ldNext = Gomonth(ts,m.ix) If Year(m.ldNext) = Year(m.te) And Month(m.ldNext) = Month(m.te) Exit Endif Endfor Return m.lnMonths