I am trying to report a simple 3 column query using MS Query from a single Table, The 3 columns are 'Sales Person [EXECNAME]', 'No of Cars Sold [ITEM]', 'No of Cars That had Finance on it' [FINANCECASES]. There is no field which simply shows YES for Finance, but the is a field with the Finance Value, so I was trying to use the IIF to simply add 1 for each record that had a FinanceValue that doesn't = 0. Here is my attempt but it is simply not working? Any help would be much appreciated.
SELECT t.EXECNAME, COUNT(t.ITEM),
IIF(SUM(t.TOTALFINANCE) = 0, 0, SUM(FINANCECASES) + 1) AS FINANCECASES
FROM t.csv t
GROUP BY t.EXECNAME
Steve