select group,iif(OPTION='YES' and count(*) as mycount > 1 , LimitAmounT, 0000) as LimitAmount,; Option group by group; from table1 into CURSOR TEMP BROWSE