Query to Count Number of Times a Value appears for certain criteri

G

Guest

This is probably a very simple task, but here it goes. I have a table for
issues that have the following columns:

[Release]
[Application]
[Issue]
[Severity]

I need a query that will list each Release and Application and the count of
Red, Yellow and Green Issues. Is this possible.

Thanks in advance,

J
 
G

Guest

I aasume that Red, Yellow and Green are found in [Severity].
The rest would be purely guesses but is it like this?
Release Application Issue Severity
1 A 23 RED
1 B 21 GREEN
1 A 12 YELLOW
2 B 3 GREEN
2 A 7 YELLOW
2 C 3 RED
2 X 1 GREEN
3 D 44 YELLOW
3 E 21 GREEN
3 S 7 YELLOW
 
G

Guest

Yes, So I would want to return something like this:

[Release] [Application] [CountOfRed] [CountOfYellow] [CountOfGreen]
1 A 1 1 0
1 B 0 0 1

KARL DEWEY said:
I aasume that Red, Yellow and Green are found in [Severity].
The rest would be purely guesses but is it like this?
Release Application Issue Severity
1 A 23 RED
1 B 21 GREEN
1 A 12 YELLOW
2 B 3 GREEN
2 A 7 YELLOW
2 C 3 RED
2 X 1 GREEN
3 D 44 YELLOW
3 E 21 GREEN
3 S 7 YELLOW


J Dizzle Fizzle said:
This is probably a very simple task, but here it goes. I have a table for
issues that have the following columns:

[Release]
[Application]
[Issue]
[Severity]

I need a query that will list each Release and Application and the count of
Red, Yellow and Green Issues. Is this possible.

Thanks in advance,

J
 
J

John Spencer

Does this do what you want?
SELECT Release, Application, Severity, Count(Severity) as CountThem
FROM YourTable
GROUP BY Release, Application, Severity


If not, you might want a Crosstab query?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top