Is there a way to include a “AND” argument based on an argument? (Specifically, include a field in query only when it’s NOT NULL). I’m trying something like the following
> WHERE something = something
> CASE WHEN @param IS NOT NULL THEN (AND something2 = something2) END
…but I’m missing something
Thanks
Just reverse your thinking about the null, you are asking for the field to null, or the other condition to be true.