I have a query with two where clauses. Example code:
SELECT CONCAT(E.Firstname, ' ',
E.Middlename, ' ',
E.Lastname, ' ',
E.Maidenname,
' (', E.Abbreviation, ')') AS Technician,
'White' AS Backcolor
FROM Employee AS E
WHERE E.Empkey NOT IN (
SELECT Empkey
FROM Taskassignation AS Ta
INNER JOIN Task AS T ON T.Taskassignationid = Ta.Taskassignationid
WHERE T.Taskstatusid != '09E02513-00AD-49E3-B442-A9ED2833FB25'
AND T.Taskstatusid != '60F68A00-A212-4B7A-B0A3-620B5887136C'
AND Empkey IS NOT NULL
AND Terminationdate IS NULL
GROUP BY Empkey
)
AND Departmentkey = 3
AND Terminationdate IS NULL
-- Now at the end of my second where I add two conditions:
WHERE T.Taskstatusid != '09E02513-00AD-49E3-B442-A9ED2833FB25'
AND T.Taskstatusid != '60F68A00-A212-4B7A-B0A3-620B5887136C'
AND Empkey IS NOT NULL
AND Terminationdate IS NULL
AND E.Title = 'Project Technician'
AND E.Title = 'Project Mgr';
For some reason query don't care my last conditions, it just get all values with all titles instead get only titles that already declared. I need to specify that filter different if I have two where clauses? Any suggestions?
Kind Regards.
[E]