The problem is that CASE returns a value, this is not a branch in the logic. The link OMG offers is pretty much an authoritative source on this (almost everything from Erland Sommarskog would be good advice).
Short summary of the link:
You can use dynamic SQL, where you create a statement based on conditions. This may often be the most effective, but there are disadvantages. One of the biggest weaknesses is potential security issues, so make sure you fully understand the SQL injection attacks and how to prevent them.
Another approach is to use complex logic in your WHERE statement using ORs. In your case, it will be something like below. This approach is slightly simpler than dynamic SQL and safer, but performance may not always be great. If performance is satisfactory for your situation (check it), stick to this approach.
SELECT *
Another way to organize the expression that I just started ...
SELECT * FROM Bank_Detail WHERE
I have not tested it yet, but I think it would be logically equivalent and could give you a more consistent query plan.
Erland also provides a couple of other possible approaches, so be sure to read his full article on this subject.
Tom h source share