This huge where
clause is generating output for all the countries however I have mentioned Mexico. Do I need to change the order of the clauses.
Please note there is one [exec] in the beginning and other 10 at the end under OR condition. Could this be the issue.
Select *
from tblKPI
WHERE Date>='2016-01-01' AND Date<='2019-01-01'
AND [Exec] LIKE 'joselinemasis'
AND Customer LIKE '%%'
AND Country LIKE 'Mexico'
AND Payroll LIKE '%%' OR [exec] = 'Albenalukanova'
OR [exec] = 'amitkumar' OR [exec] = 'AsthaChadha'
OR [exec] = 'barbaranyari' OR [exec] = 'BereniceParedes'
OR [exec] = 'Bhawnasingh' OR [exec] = 'edgaralcantara'
OR [exec] = 'elidethcisneros' OR [exec] = 'FruzsinaKaraszi'
OR [exec] = 'joselinemasis'