Hi Experts
I recently purchased a copy of Gordon's book to help me create a pivot query based on the examples at the end which I hope to show me a set of data based on my Sales Order tables. Unfortunately I have found it a little too complex.
In my ORDR table I have 10 UDFs which relate to various statuses and dates in the sales order process.
What I would like is to see a pivot table query of the sum quanties of items at the different stages (as rows) against the dates in weeks.
In the rows would be the status UDF fields:
U_DES_STAGE
U_PRN_STAGE
U_PRS_STAGE
U_SEW_STAGE
U_EMB_STAGE
for each UDF there is an associated date UDF
U_DES_STAGE_DATE
U_PRN_STAGE_DATE
U_PRS_STAGE_DATE
U_SEW_STAGE_DATE
U_EMB_STAGE_DATE
The columns I require in the pivot table would be the UDF stage dates which are always input for the week ending Friday.
The data in the pivot should be the sum of the quantities in the sales orders rows RDR1.
Stage | W/E 14/3/2014 | W/E 21/3/2014 | W/E 28/3/2014 | W/E 4/4/2014 | W/E 11/4/2014 | W/E 18/4/2014 |
---|---|---|---|---|---|---|
DES | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty |
PRN | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty |
PRS | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty |
SEW | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty |
EMB | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty | Sum of Qty |
The problem is that I am not sure as to how to add the WHERE clause to limit the results to only the 5 items (DES% or PRN% or PRS% or SEW% or EMB%)
I would be very grateful for any assistance.
Regards
Geoff