WHEN Count(e1.ErrorCode) <= 3 Then Green
WHEN Count(e1.ErrorCode) > 3 AND Count(e1.ErrorCode) <= 6 Then Yellow
WHEN Count(e1.ErrorCode) > 6 Then Red
END as [Category 1],
WHEN Count(e2.ErrorCode) <= 3 Then Green
WHEN Count(e2.ErrorCode) > 3 AND Count(e2.ErrorCode) <= 6 Then Yellow
WHEN Count(e2.ErrorCode) > 6 Then Red
END as [Category 2]
FROM ticket_view e1
Left Join ticket_view e2 on e2.category = 'Category 2'
WHERE e1.category = 'Category 1'
Obviously you would wnat to join 3 more times to get the last 3 categories but you get the idea. The column name will be your category and the value of that column will be a color.
Read this if you want to know how to get a correct reply for your question:
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
Technical Editor for: Professional Search Engine Optimization with ASP.NET
Why can't Programmers, program??