I'm passing through a variable into my stored procedure and was writing a case statement in my WHERE clause. Normally I would write it something like this:

```
CodeID like CASE WHEN @Duration != '0' 
                THEN '%' + @Duration 
                ELSE '%' END

```

The problem, however, is that this isn't quite what I need. What I actually need is something with the logic of *IF @Duration != '0' THEN CodeID like '%' + @Duration ELSE CodeID doesn't end with a digit.*

Is this possible? I considered writing a couple of IF statements with the respective queries in each, but as there isn't a wildcard for digit, I'm having some trouble with this logic as well.