I'm very new to creating union queries. I understand the purpose but not how to properly implement it for my purpose. So far I've created to perfectly fine crosstab queries. One shows input on a date ordered, the other shows the out put on a date completed.
I am trying to combine these two charts into one chart. The code I've got so far will only show one date. I am looking to have 2 (4 if you count the break down into the two material types) line graphs.
Here is the code for this so far.
Input:
Output:
Union:
As always, Thanks in Advance!
I am trying to combine these two charts into one chart. The code I've got so far will only show one date. I am looking to have 2 (4 if you count the break down into the two material types) line graphs.
Here is the code for this so far.
Input:
Code:
TRANSFORM Sum(tblOrders.QtyOrdered) AS SumOfQtyOrdered SELECT tblOrders.DateOrdered, Sum(tblOrders.QtyOrdered) AS [Total Of QtyOrdered] FROM tblOrders GROUP BY tblOrders.DateOrdered PIVOT tblOrders.MaterialType;
Code:
TRANSFORM Sum(tblOrders.QtyCompleted) AS SumOfQtyCompleted SELECT tblOrders.DateCompleted, Sum(tblOrders.QtyCompleted) AS [Total Of QtyCompleted] FROM tblOrders GROUP BY tblOrders.DateCompleted PIVOT tblOrders.MaterialType;
Code:
SELECT * FROM [qryTPInput_Crosstab] UNION SELECT * FROM [qryTPOutput_Crosstab]
Comment