0
我有兩個表:MS訪問SQL查詢結果
rapprovals_tbl
rId rAssignment rState rApprover rapprovaldt rType rNotes
12345678
1 12345679 Paid 12345678 31/05/2015 18:23 Flex
5 12345679 Approved 12345678 14/05/2015 18:23 Normal
6 12345679 Pending Normal
timerecord_tbl
RowID Assignment1 wMonth StartTime EndTime
1 12345679 Mar-15 17/03/2015 11:29 18/03/2015 16:12 Flex
5 12345679 Mar-15 17/03/2015 11:00 17/03/2015 12:00 Normal
6 12345679 Mar-15 17/03/2015 11:50 18/03/2015 16:11 Normal
我有形式兩個組合框,這兩篇文章,這源工作; 框1 -
Select [staffid] FROM [control_tbl] WHERE [supervisorid] = '12345678'
專欄2
SELECT timerecord_tbl.[RowID]
FROM timerecord_tbl
INNER JOIN rapprovals_tbl ON timerecord_tbl.RowID = rapprovals_tbl.rId
WHERE (((timerecord_tbl.[Assignment1])='" & Box 1 & "'
AND (rapprovals_tbl.[rState] is null) Or (rapprovals_tbl.[rState] = 'Pending')));
我想只有那些以箱1個員工記錄專欄2
我如何去了解這個相關的RowID,目前其列出了所有行ID。
我將不勝感激任何幫助。
你有'和'和'或'混合而不使用'()'來執行執行順序。你可能想'AND((...)OR(...))'。注意額外的'()'。 –