[英]Select Distinct with Where Clause
I am trying to get all active Matrix Managers in the ComboBox
, but what I am getting is Active
as well as Non-Active
. 我试图在
ComboBox
获取所有活动的Matrix Manager,但是我获得的是Active
和Non-Active
。
Could anyone help me to correct my query: 谁能帮助我更正我的查询:
cmbTL.RowSourceType = "Table/Query"
cmbTL.RowSource = "SELECT Distinct Matrix_Manager FROM EmpMasterTbl WHERE Status='Active'"
Note: I am using MS Access 2013 DAO. 注意:我正在使用MS Access 2013 DAO。
I suspect that you want: 我怀疑您想要:
SELECT Matrix_Manager
FROM EmpMasterTbl
GROUP BY Matrix_Manager
HAVING MIN(Status) = "Active" AND MAX(Status) = "Active";
This will get managers that have only active status. 这将使管理者仅具有活动状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.