He is trying to get a result of three columns: Fee Earning (containing their grouped name), File summary (containing the amount of times a "no" has been entered), and Letterhead (containing the amount of time a "no" has been entered there).
Code: Select all
SELECT matters.FeeEarner,
Count(matters.FileSummary) AS FileSummary,
Count(matters.Letterhead) AS Letterhead
FROM matters
WHERE matters.FileSummary ='no' OR
WHERE matters.FileSummary ='no'
GROUP BY matters.feeEarner;
If the 'FeeEarning' has three NOs in fileSummary and two YESs in Letterhead, the result needs to be:
FeeEarningName - 3, 2.
Hope someone can help.
Simon