I'm trying to create a SSRS report for pulling employee records.
Depending on the parameter value for @workgroup at run-time, I want the query to select records based on specific status. I tried the below case statement in where clause but it is not working.
-------------------------------------------
FROM EMPLOYEE E LEFT OUTER JOIN DEPT D ON E.DEPT = D.CODE LEFT OUTER JOIN ORGUNIT O ON O.CODE = E.ORGUNIT LEFT OUTER JOIN JOB J ON E.JOB = J.CODE WHERE E.FLDWORKGRP = @workgroup AND CASE WHEN @workgroup = 'Value' THEN E.STATUS = 'A' ELSE E.STATUS IN ('A','N','LOA','P','D') END ORDER BY E.LNAME
Let me know if there is any other way to do this. Thanks in advance for your help.