Drawing a blank on this and need help.
I have the following table:
<caption>active</caption>
<thead>
[TH="bgcolor: #c0c0c0"] Supplier [/TH]
[TH="bgcolor: #c0c0c0"] Item [/TH]
[TH="bgcolor: #c0c0c0"] Status [/TH]
</thead>
<tbody>
</tbody>
<tfoot></tfoot>
I'm trying to filter the results so it only will show groups of Supplier / Item if all of the Status = JC
I was able to put together a query that counts the number of status for each group and another that counts the JC's but am drawing a blank now.
Count Query:
SELECT active.SUPPLIER, active.ITEM, Count(*) AS Expr1
FROM active
GROUP BY active.SUPPLIER, active.ITEM;
Job Complete Count:
SELECT active.SUPPLIER, active.ITEM, Count(*) AS Expr1
FROM active
WHERE STATUS = "JC"
GROUP BY active.SUPPLIER, active.ITEM;
If the count result = the same as the job complete count for the same group I'm trying to get it to show all of them, and if not filter the whole group out.
I have the following table:
SW39 | 000013 | WP |
SWM2 | 000024 | M5 |
SW39 | 000013 | M8 |
SWM2 | 000006 | M5 |
GMFQ | PTG513 | M8 |
GMFQ | PTG513 | M5 |
GJCA | 137014 | WP |
GJCA | 137015 | WP |
SWM2 | 000036 | M3 |
SHCP | NA3294 | M3 |
SC22 | DDH150 | M5 |
SC22 | DDH027 | M8 |
SW1V | NPB152 | M8 |
SC22 | DDH035 | M8 |
S5CH | A35003 | M8 |
SC22 | DDH101 | M5 |
YZAA | 041985 | M5 |
SWGI | 000037 | M8 |
GDCC | ADL590 | M3 |
SW1V | NPB152 | M5 |
SC22 | 130666 | M3 |
SW39 | MRP026 | JC |
GDHC | 475559 | JC |
GDHC | 475565 | JC |
SCCB | DAN017 | M8 |
SC22 | DDH035 | M3 |
SC22 | DDH027 | M3 |
SH01 | 620066 | JC |
S5CH | A35003 | JC |
SWGI | 000037 | JC |
SC22 | DDH158 | M8 |
SC22 | DDH158 | M3 |
SC22 | DDH129 | M8 |
SC22 | DDH129 | M3 |
SCCB | DAN017 | M3 |
SWM2 | 000008 | JC |
SWM2 | 000024 | JC |
SC22 | DDH158 | M3 |
SC22 | DDH129 | M3 |
SWM2 | 000008 | M3 |
SWM2 | 000024 | M3 |
SWM2 | 000008 | M3 |
SWM2 | 000008 | JC |
SWM2 | 000008 | JC |
SWM2 | 000008 | M3 |
GMC6 | NA2055 | M3 |
GMC6 | NA2055 | M3 |
GMC6 | NA2055 | M3 |
SWM2 | 000036 | M3 |
SWM2 | 000008 | M3 |
<thead>
[TH="bgcolor: #c0c0c0"] Supplier [/TH]
[TH="bgcolor: #c0c0c0"] Item [/TH]
[TH="bgcolor: #c0c0c0"] Status [/TH]
</thead>
<tbody>
</tbody>
<tfoot></tfoot>
I'm trying to filter the results so it only will show groups of Supplier / Item if all of the Status = JC
I was able to put together a query that counts the number of status for each group and another that counts the JC's but am drawing a blank now.
Count Query:
SELECT active.SUPPLIER, active.ITEM, Count(*) AS Expr1
FROM active
GROUP BY active.SUPPLIER, active.ITEM;
Job Complete Count:
SELECT active.SUPPLIER, active.ITEM, Count(*) AS Expr1
FROM active
WHERE STATUS = "JC"
GROUP BY active.SUPPLIER, active.ITEM;
If the count result = the same as the job complete count for the same group I'm trying to get it to show all of them, and if not filter the whole group out.