SELECT office , department, COUNT(office) AS total_cfil, ; SUM(IIF(flg="!", 1, 0)) As subtotal ,; COUNT(*)-SUM(IIF(flg='1',1,0)) AS newfield ; FROM New1 ; GROUP BY department,office INTO TABLE Mucurt>
>SUM(IIF(flg="!", 1, 0) As subtotal >>>
>>SELECT office , department,count(office) as total_cfil && and count(office) as sub-total where flg="1" and newfield have( total_cfil -sub-total) ; >>from new1 ; >>group by department,office INTO table mucurt >>>>