SELECT DISTINCT *
FROM [Verified].[Members] AS M
WHERE (CASE WHEN ISNULL(@SearchText, '') <> '' 
			 THEN (CASE WHEN M.[FirstNames] LIKE '%' + @SearchText + '%' THEN 1 ELSE 0 END) 
			 ELSE 1 END) = 1 
AND (CASE WHEN ISNULL(@FirstName, '') <> '' 
			THEN (CASE WHEN M.[FirstNames] LIKE '%' + @FirstName + '%' OR M.[FullName] LIKE '%' + @FirstName + '%' THEN 1 ELSE 0 END) 
			ELSE 1 END) = 1 
AND (CASE WHEN ISNULL(@LastName, '') <> '' 
			THEN (CASE WHEN M.[SurnameOrCompanyName] LIKE '%' + @LastName + '%' OR M.[FullName] LIKE '%' + @LastName + '%' THEN 1 ELSE 0 END) 
			ELSE 1 END) = 1 
ORDER BY M.[FullName] ASC