iif(inlist(alltrim(ccStatus), 'A', 'P', .T., .F.)first of all, the inlist is quite unnecessary, since the condition by itself will already give .T. or .F. Second, for single characters, the $ operator can be used. The entire line can then be written as:
... alltrim(ccStatus) $ 'AP' as lPPrnt;Similarly, in the statement you marked as "invalid": instead of comparing logical fields to .T. or .F., just use the logical fields themselves. That is:
* Instead of lPrnt = .T. * it is sufficient to put lPrnt * and, instead of lPrnt = .F. * you could also write not lPrnt && or !lPrint>
>*//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 >