March 13, 2015 at 9:03 am
Hi,
I have a stored procedure, with "nullable" parameters.
The first line works as expected. I can't get the second line to work.
Any suggestions?
Cheers,
Julian
--(J.[Week] >= @WeekBegin OR @WeekBegin is null) AND (J.[Week] <= @WeekEnd OR @WeekEnd is null)
(J.[Week] BETWEEN (@WeekBegin OR @WeekBegin is null) AND (@WeekEnd OR @WeekEnd is null))
March 13, 2015 at 9:45 am
Could you use something like this?
J.[Week] BETWEEN ISNULL(@WeekBegin, -1) AND ISNULL(@WeekEnd, 9999999)
Functions on parameters don't affect SARGability.
March 13, 2015 at 9:50 am
Hello Luis,
Great, that works, thank you.
Cheers,
Julian
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply