*//Master Cursor SELECT regno, ccstatus, ; IIF(Inlist(Alltrim(ccstatus),'A','P'),.T.,.F.) as lPrnt; FROM cTemp; ORDER BY regno ; Into Cursor cRegno *//Invalid SELECT regno from cRegno ; where lPrnt = .F. ; Group by regno order by regno into Cursor cInvalid *//Valid SELECT regno from cRegno ; where regno not in (select regno from cInvalid); Group by regno order by regno ; Into Cursor cValid