GetRangeCursor('Jan','May','myCursor') GetRangeCursor('Feb','May') GetRangeCursor('Feb') Function GetRangeCursor Lparameters tcStart,tcEnd,tcCursorName tcCursorName = Iif(Empty(m.tcCursorName),'empRange',m.tcCursorName) If Empty(m.tcEnd) Select * ; from ( 'Emp'+m.tcStart ) ; into Cursor (m.tcCursorName) ; readwrite Return Endif Local Array aTables[12] Local ix For ix=1 To 12 aTables[m.ix] = Upper('Emp'+Left(Cmonth(Date(2000,m.ix,1)),3)) Endfor Select * ; from ( aTables[Ascan(aTables,'EMP'+Upper(m.tcStart))] ) ; into Cursor (m.tcCursorName) ; readwrite For ix = Ascan(aTables,'EMP'+Upper(m.tcStart)) + 1 To ; Ascan(aTables,'EMP'+Upper(m.tcEnd)) Append From ( aTables[m.ix] ) EndforCetin