S
StevieD via AccessMonster.com
Hi, Im currently running the following query:
------------------------------------------------------------------------------
--------------
PARAMETERS [Start Date] DateTime, [Finish Date] DateTime, [MachineCodeA] Text
( 255 );
SELECT DISTINCTROW [SALES STATUS].Ss_WO_NO, [DESPATCH STATUS].Ds_Instance,
[SALES STATUS].[Ss_DATE_REC'D], [SALES STATUS].Ss_QUOTE_NO, [SALES STATUS].
Ss_CUSTOMER_NAME, [SALES STATUS].Ss_CODE, [SALES STATUS].Ss_CUST_ORD_NO,
[SALES STATUS].[Ss_PART_NO/DRWG], [SALES STATUS].Ss_ISSUE_NO, [SALES STATUS].
Ss_QTY, [SALES STATUS].Ss_PRICE_PER_100, [DESPATCH STATUS].
[Ds_DATE_Ship_Req'd], [DESPATCH STATUS].Ds_WK_ACK, [DESPATCH STATUS].
[Ds_QTY_REQ'D], [DESPATCH STATUS].[Ds_DATE_REQ'D], [DESPATCH STATUS].
[Ds_WK_REQ'D], [DESPATCH STATUS].Ds_DESPATCH_QTY, [DESPATCH STATUS].
Ds_DESPATCH_DATE, [Ds_QTY_REQ'D]*[Ss_PRICE_PER_100]/100 AS Expr1, [DESPATCH
STATUS].Ds_DATE_ACK, [DESPATCH STATUS].Ds_Ship_Comment, MachineCode.
MachineCode AS MCA, MachineCode_1.MachineCode AS MCB, MachineCode_2.
MachineCode AS MCC, Status.Status AS SA, Status_1.Status AS SB, Status_2.
Status AS SC
FROM [SALES STATUS] INNER JOIN (((((([DESPATCH STATUS] LEFT JOIN MachineCode
ON [DESPATCH STATUS].MachineCodeA = MachineCode.ID) LEFT JOIN MachineCode AS
MachineCode_1 ON [DESPATCH STATUS].MachineCodeB = MachineCode_1.ID) LEFT JOIN
MachineCode AS MachineCode_2 ON [DESPATCH STATUS].MachineCodeC =
MachineCode_2.ID) LEFT JOIN Status ON [DESPATCH STATUS].StatusA = Status.ID)
LEFT JOIN Status AS Status_1 ON [DESPATCH STATUS].StatusB = Status_1.ID) LEFT
JOIN Status AS Status_2 ON [DESPATCH STATUS].StatusC = Status_2.ID) ON [SALES
STATUS].Ss_WO_NO = [DESPATCH STATUS].Ds_WO_NO
WHERE ((([DESPATCH STATUS].[Ds_DATE_Ship_Req'd]) Between [Start Date] And
[Finish Date]) AND ([MachineCode].[MachineCode])=MachineCodeA AND ((
[DESPATCH STATUS].[Ds_QTY_REQ'D]) Is Not Null) AND (([DESPATCH STATUS].
Ds_DESPATCH_QTY)=0));
------------------------------------------------------------------------------
--------------
Bascially this script makes the user select a 'Start Date', 'End Date' and
'MachineCodeA' I also have a MachineCodeB and MachineCodeC field.
I would like the user to be able to simply enter the Start date, End date,
and then MachineCode and for it to look for what is entered in the
MachineCodeA,B or C fields.?
Any ideas?
------------------------------------------------------------------------------
--------------
PARAMETERS [Start Date] DateTime, [Finish Date] DateTime, [MachineCodeA] Text
( 255 );
SELECT DISTINCTROW [SALES STATUS].Ss_WO_NO, [DESPATCH STATUS].Ds_Instance,
[SALES STATUS].[Ss_DATE_REC'D], [SALES STATUS].Ss_QUOTE_NO, [SALES STATUS].
Ss_CUSTOMER_NAME, [SALES STATUS].Ss_CODE, [SALES STATUS].Ss_CUST_ORD_NO,
[SALES STATUS].[Ss_PART_NO/DRWG], [SALES STATUS].Ss_ISSUE_NO, [SALES STATUS].
Ss_QTY, [SALES STATUS].Ss_PRICE_PER_100, [DESPATCH STATUS].
[Ds_DATE_Ship_Req'd], [DESPATCH STATUS].Ds_WK_ACK, [DESPATCH STATUS].
[Ds_QTY_REQ'D], [DESPATCH STATUS].[Ds_DATE_REQ'D], [DESPATCH STATUS].
[Ds_WK_REQ'D], [DESPATCH STATUS].Ds_DESPATCH_QTY, [DESPATCH STATUS].
Ds_DESPATCH_DATE, [Ds_QTY_REQ'D]*[Ss_PRICE_PER_100]/100 AS Expr1, [DESPATCH
STATUS].Ds_DATE_ACK, [DESPATCH STATUS].Ds_Ship_Comment, MachineCode.
MachineCode AS MCA, MachineCode_1.MachineCode AS MCB, MachineCode_2.
MachineCode AS MCC, Status.Status AS SA, Status_1.Status AS SB, Status_2.
Status AS SC
FROM [SALES STATUS] INNER JOIN (((((([DESPATCH STATUS] LEFT JOIN MachineCode
ON [DESPATCH STATUS].MachineCodeA = MachineCode.ID) LEFT JOIN MachineCode AS
MachineCode_1 ON [DESPATCH STATUS].MachineCodeB = MachineCode_1.ID) LEFT JOIN
MachineCode AS MachineCode_2 ON [DESPATCH STATUS].MachineCodeC =
MachineCode_2.ID) LEFT JOIN Status ON [DESPATCH STATUS].StatusA = Status.ID)
LEFT JOIN Status AS Status_1 ON [DESPATCH STATUS].StatusB = Status_1.ID) LEFT
JOIN Status AS Status_2 ON [DESPATCH STATUS].StatusC = Status_2.ID) ON [SALES
STATUS].Ss_WO_NO = [DESPATCH STATUS].Ds_WO_NO
WHERE ((([DESPATCH STATUS].[Ds_DATE_Ship_Req'd]) Between [Start Date] And
[Finish Date]) AND ([MachineCode].[MachineCode])=MachineCodeA AND ((
[DESPATCH STATUS].[Ds_QTY_REQ'D]) Is Not Null) AND (([DESPATCH STATUS].
Ds_DESPATCH_QTY)=0));
------------------------------------------------------------------------------
--------------
Bascially this script makes the user select a 'Start Date', 'End Date' and
'MachineCodeA' I also have a MachineCodeB and MachineCodeC field.
I would like the user to be able to simply enter the Start date, End date,
and then MachineCode and for it to look for what is entered in the
MachineCodeA,B or C fields.?
Any ideas?