LeonelSanchezJr
Programmer
I am trying to write a query to pull only certain records from Table_B where that customer code has the Required Document type.
Table_A contains the Customer Codes and Required Document Types.
Here's what I have so far:
Select Table_B.cDocNum, Table_B.cCustCode, Table_B.cDocType from Table_B
Left Join Table_C on Table_B.cDocNum = Table_C.cDocNum
Where Table_B.cCustCode In (Select Table_1.cCustCode
From Table_1)
And Table_B.dDueDate Between '06/25/01' and '06/28/01'
Order By Table_B.cCustCode, Table_B.cDocType,
Table_B.chawbnum
Table_A contains the Customer Codes and Required Document Types.
Here's what I have so far:
Select Table_B.cDocNum, Table_B.cCustCode, Table_B.cDocType from Table_B
Left Join Table_C on Table_B.cDocNum = Table_C.cDocNum
Where Table_B.cCustCode In (Select Table_1.cCustCode
From Table_1)
And Table_B.dDueDate Between '06/25/01' and '06/28/01'
Order By Table_B.cCustCode, Table_B.cDocType,
Table_B.chawbnum