FOR nMonth = 1 TO 12 lcMonth = GetAlphaMonth(nMonth) ldDate = CTOD(PADL(nMonth,2,"0")+"/01/2010") ldBegDateOfMonth=ldDate - DAY(ldDate) + 1 ldEndDateOfMonth=GOMONTH(ldDate - DAY(ldDate) + 1,1) - 1 SELECT lcMonth+" 2010" AS Month_Year, ; GrpID, Emp_ID, ; SUM(bill_prem) AS Month_Billed, ; BnftName, ; 0000000.00 AS Month_Collected ; FROM tmp1 ; WHERE BETWEEN(bill_date, ldBegDateOfMonth, ldEndDateOfMonth); INTO CURSOR '+"tmp" +str(nMonth)+' ; GROUP BY GrpID, Emp_ID, BnftName ENDFOR