多个子句不起作用

时间:2019-04-22 20:43:58

标签: sql ms-access access

我的where子句无法正常工作,我不知道为什么。我正在尝试删除所有以9开头的帐号,并且下面列出的所有实体代码将从我的结果中删除。它正在运行查询,但是使用以9开头并列出该实体的帐户。

SELECT [Emp List].ID, 
[Emp List].FirstName, 
[Emp List].LastName, 
dbo_person.prsn_crd_nbr, 
dbo_person.prsn_emp_id, 
Left([dbo_account]![account_id],8) AS Account, 
dbo_account.holder_name, 
dbo_account.entity_id
FROM (([Emp List] LEFT JOIN dbo_person ON [Emp List].emp_id = dbo_person.prsn_emp_id) 
LEFT JOIN dbo_account ON dbo_person.prsn_emp_id = dbo_account.fa_emp_id) 
LEFT JOIN dbo_account_holder ON dbo_account.account_id = dbo_account_holder.account_id
WHERE (((dbo_account.entity_id) Not Like "%7671%" 
AND (entity_id) Not Like "%851%" 
AND (entity_id) Not Like "%871%"
AND (entity_id) Not Like "%3731%" 
AND (entity_id) Not Like "%3291%") 
AND ((dbo_account_holder.account_id)<>"False") 
AND ((dbo_account.account_id) Not Like "%9%") 
AND ((dbo_account.date_account_closed) Is Null));

0 个答案:

没有答案