SELECT employee, COUNT( case when type= '0' then 1 else null end ) as COUNT_0, COUNT( case when type= '1' then 1 else null end ) as COUNT_1 FROM MyTable GROUP BY employeeBut when I do the following in VFP, I don't get the expected results:
SELECT employee, COUNT( IIF( type= '0', 1, 0 ) ) as COUNT_0, COUNT( IIF( type = '1',1,0)) as COUNT_1 FROM MyTable WHERE GROUP BY employeeIn VFP expression all records are counted. How do I make VFP SQL Select work as the SQL Server?