You need to be VERY CAREFUL whenever you use Dynamic SQL because it opens you up to SQL Injection attacks. Here is a version that should work without Dynamic SQL and will also solve your problem.Select *,T3.Address as [Finish Location Address],T3.City as [Finish Location City], T3.State as [Finish Location State]From fnKPIStartLocations() T1Left Outer Join dbo.RealEstate T3 ON T1.PropertyIDFinishLoc = T3.PropertyID Where TaskId > 0 And IsNull(@SelectedCategory, '') In ('Lead', 'Responsible', 'PM')And Case When IsNull(@SelectedCategory, '') = 'Lead' Then Lead When IsNull(@SelectedCategory, '') = 'Responsible' Then Responsible When IsNull(@SelectedCategory, '') = 'PM' Then PMEnd Like '%' + @SearchWord + '%'