I am trying to have a parameter that either filters out interns or includes interns and every other job title using a column that holds 'Yes' or 'No' whether that job title is an intern.
The basics of my code are like this:
SELECT
Date
,BillHours
,OrgArea
,Jobtitle
,InternYesNo
FROM(
SELECT
Date
,BillHours
,OrgArea
,Jobtitle
,CASE WHEN LEFT(jobtitle, 6) = 'Intern' THEN 'Yes' ELSE 'No' END AS 'InternYesNo') MainQuery
WHERE InternYesNo IN(@includeinterns)
So I'm thinking I want to specify the available values in the @includeinterns parameter, but I think I would need to have one of the values be an expression so that it includes both 'Yes' and 'No' rows based on the InternYesNo column.
My question is how do I write an expression for specifying values so that one of the available values includes both 'Yes' and 'No' rows? Do I need an additional dataset to hold those values? Or is there better way to accomplish this?