In your TASKS database you have records in various categories.
You need to produce a summarized report with 3 columns:
Task Category | Tasks Open | Tasks Completed
Regular count will not work. You have to use a conditional count.
tkCategory AS TaskCategory,
COUNT(CASE WHEN tkDoneYN = 0 THEN 1 ELSE NULL END) AS TasksOpen,
COUNT(CASE WHEN tkDoneYN = 1 THEN 1 ELSE NULL END) AS TasksCompleted
GROUP BY tkCategory