I have tried several ways to build this crosstab query, but can't get results.
Result Desired: A crosstab query with row heading-partID and column heading orderDate, the value is quantity. A query for each customer. This isn't a problem so far, here's the twist: I want to sum the past due quantities (quanties due before the start date)in a colummn for each partID. The past due date range goes back 30 days before the schedule start date.
Table: sales
Fields: customerID, partID, orderDate, quantity
I have created a query that gives me the data I want, and I can create the correct crosstab for a date range. The user selects a date and the crosstab shows five days of schedule beginning on date selected. The problem is the past due quantities.
Select Query used to create the crosstab:
PARAMETERS [forms]![frmselect]![txtchoice] Text ( 255 ), [forms]![frmselect]![txtbegdate] DateTime, [forms]![frmselect]![txtenddate] DateTime;
SELECT DISTINCTROW SALES.ORDER_ID, SALES.PART_ID, SALES.TARGET_COMPLETION AS [ORDER DATE], SALES.PROJECTED_COMPLETION AS [SHIPPING DATE], [SALES]![ORDER_QTY]-[SALES]![QTY_SHIPPED] AS QUANTITY, SALES.QTY_SHIPPED, SALES.TARGET_COMPLETION
FROM SALES
WHERE (((SALES.ORDER_ID)=[forms]![frmselect]![txtchoice]) AND ((SALES.TARGET_COMPLETION) Between [forms]![frmselect]![txtbegdate] And [forms]![frmselect]![txtenddate]) AND (([SALES]![ORDER_QTY]-[SALES]![QTY_SHIPPED])>0))
ORDER BY SALES.ORDER_ID, SALES.PART_ID;
Thanks for any ideas.
Result Desired: A crosstab query with row heading-partID and column heading orderDate, the value is quantity. A query for each customer. This isn't a problem so far, here's the twist: I want to sum the past due quantities (quanties due before the start date)in a colummn for each partID. The past due date range goes back 30 days before the schedule start date.
Table: sales
Fields: customerID, partID, orderDate, quantity
I have created a query that gives me the data I want, and I can create the correct crosstab for a date range. The user selects a date and the crosstab shows five days of schedule beginning on date selected. The problem is the past due quantities.
Select Query used to create the crosstab:
PARAMETERS [forms]![frmselect]![txtchoice] Text ( 255 ), [forms]![frmselect]![txtbegdate] DateTime, [forms]![frmselect]![txtenddate] DateTime;
SELECT DISTINCTROW SALES.ORDER_ID, SALES.PART_ID, SALES.TARGET_COMPLETION AS [ORDER DATE], SALES.PROJECTED_COMPLETION AS [SHIPPING DATE], [SALES]![ORDER_QTY]-[SALES]![QTY_SHIPPED] AS QUANTITY, SALES.QTY_SHIPPED, SALES.TARGET_COMPLETION
FROM SALES
WHERE (((SALES.ORDER_ID)=[forms]![frmselect]![txtchoice]) AND ((SALES.TARGET_COMPLETION) Between [forms]![frmselect]![txtbegdate] And [forms]![frmselect]![txtenddate]) AND (([SALES]![ORDER_QTY]-[SALES]![QTY_SHIPPED])>0))
ORDER BY SALES.ORDER_ID, SALES.PART_ID;
Thanks for any ideas.