Hi!
I'm glad you solved your problem.
I just forget that SUM was required instead of count() in your case. Anyway, you approach might be even more efficient...
>I got it! I modified your statement to this:
>
>Select Sys, COUNT(CASE Status WHEN Status=1 THEN 1 END) as successful,
>COUNT(CASE Status WHEN 2 THEN 1 END) as failed,
>COUNT(CASE Status WHEN 3 THEN 1 END) as invalid,
>COUNT(CASE Status WHEN 0 THEN 1 END) as pending
>FROM MyTable GROUP BY Sys
>
>Again, thank you very much!
>
>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.