>FOR p_count = 1 TO 12 > file_name = ALLTRIM(STR(p_count)) > SELECT * FROM weights WHERE MONTH(date1) = p_count INTO TABLE d:\ahsan+(file_Name) >NEXT >CLOSE ALL >>But above codes retreive data of only last month as well as create one dbf instead of 12.
FOR p_count = 1 TO 12 sMonth= LTRIM(STR(p_count)) SELECT * FROM weights WHERE MONTH(date1) = &sMonth INTO TABLE (d:\ahsan+m.sMonth) NEXT CLOSE ALL