L
ldiaz
here is the statements
==================================================
SELECT IDVolatilDBID_lbl.User6 AS Style,
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",1,0))
AS [Sum Of Qty (Rel-BAM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="JAXM-06",1,0))
AS [Sum Of Qty (Rel-JAXM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",([IDVolatilDBID_lbl.Cut_Process_Release])=Yes))
AS [Sum Of Qty (CUT-BAM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="JAXM-06",([IDVolatilDBID_lbl.Cut_Process_Release])=Yes)) AS [Sum Of Qty (CUT-JAXM-06)]
FROM To_Update_Excel_r1 INNER JOIN IDVolatilDBID_lbl ON
To_Update_Excel_r1.WO_ID = IDVolatilDBID_lbl.WO_ID
WHERE (((IDVolatilDBID_lbl.Planner)="BAM-06" Or
(IDVolatilDBID_lbl.Planner)="JAXM-06")) OR
(((IDVolatilDBID_lbl.Planner)="BAM-06" Or
(IDVolatilDBID_lbl.Planner)="JAXM-06") AND
((IDVolatilDBID_lbl.Cut_Process_Release)=Yes))
GROUP BY IDVolatilDBID_lbl.User6
ORDER BY
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",1,0)) DESC;
==================================================
==================================================
SELECT IDVolatilDBID_lbl.User6 AS Style,
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",1,0))
AS [Sum Of Qty (Rel-BAM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="JAXM-06",1,0))
AS [Sum Of Qty (Rel-JAXM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",([IDVolatilDBID_lbl.Cut_Process_Release])=Yes))
AS [Sum Of Qty (CUT-BAM-06)],
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="JAXM-06",([IDVolatilDBID_lbl.Cut_Process_Release])=Yes)) AS [Sum Of Qty (CUT-JAXM-06)]
FROM To_Update_Excel_r1 INNER JOIN IDVolatilDBID_lbl ON
To_Update_Excel_r1.WO_ID = IDVolatilDBID_lbl.WO_ID
WHERE (((IDVolatilDBID_lbl.Planner)="BAM-06" Or
(IDVolatilDBID_lbl.Planner)="JAXM-06")) OR
(((IDVolatilDBID_lbl.Planner)="BAM-06" Or
(IDVolatilDBID_lbl.Planner)="JAXM-06") AND
((IDVolatilDBID_lbl.Cut_Process_Release)=Yes))
GROUP BY IDVolatilDBID_lbl.User6
ORDER BY
Sum([IDVolatilDBID_lbl].[Qty]*IIf([IDVolatilDBID_lbl].[Planner]="BAM-06",1,0)) DESC;
==================================================