SyntaxFix
Write A Post
Hire A Developer
Questions
... WHERE ... AND (@Location is null OR (Location like '%' + @Location + '%')) AND (@Date is null OR (Date = @Date))
This way it is more obvious the parameter is not used when null.