C
CevinMoses
I have 3 shifts defined by the ID number of their foremen [Cast Forman
Clock]. Product 4620 can have several defects [Defect Code], of which "04"
is the one I am trying to analyze. I have been able to calculate the
percentage of Defect-04 / the total number of pieces for the month of
October. I can also calculate the percentage of Defect-04 each shift made /
the total number of pieces made by all three shifts. However, all three
shifts did not make the same number of pieces, and I would like to calculate
the percentage of the Defect-04 each shift made / the total pieces made BY
THAT SHIFT. My current code is below. CountShift was intended to count the
number of pieces that each shift made, but it returns the total number of
pieces made by all 3 shifts instead.
SELECT Oct06_4620.[Defect Code], Count(Oct06_4620.[Defect Code]) AS
CountGrade, (SELECT Count([Cast Foreman Clock]) From [Oct06_4620]) AS
CountShift, Count([Inspect Grade])/(SELECT Count([Inspect Grade]) From
[Oct06_4620]) AS Percentage, Oct06_4620.[Cast Foreman Clock]
FROM Oct06_4620
GROUP BY Oct06_4620.[Defect Code], Oct06_4620.[Cast Foreman Clock]
HAVING (((Oct06_4620.[Defect Code])="04"));
Thanks,
Cevin
Clock]. Product 4620 can have several defects [Defect Code], of which "04"
is the one I am trying to analyze. I have been able to calculate the
percentage of Defect-04 / the total number of pieces for the month of
October. I can also calculate the percentage of Defect-04 each shift made /
the total number of pieces made by all three shifts. However, all three
shifts did not make the same number of pieces, and I would like to calculate
the percentage of the Defect-04 each shift made / the total pieces made BY
THAT SHIFT. My current code is below. CountShift was intended to count the
number of pieces that each shift made, but it returns the total number of
pieces made by all 3 shifts instead.
SELECT Oct06_4620.[Defect Code], Count(Oct06_4620.[Defect Code]) AS
CountGrade, (SELECT Count([Cast Foreman Clock]) From [Oct06_4620]) AS
CountShift, Count([Inspect Grade])/(SELECT Count([Inspect Grade]) From
[Oct06_4620]) AS Percentage, Oct06_4620.[Cast Foreman Clock]
FROM Oct06_4620
GROUP BY Oct06_4620.[Defect Code], Oct06_4620.[Cast Foreman Clock]
HAVING (((Oct06_4620.[Defect Code])="04"));
Thanks,
Cevin