Good day everyone,
Today I have run into an issue regaurding case statemtents within a where clasue. Specifically within an IN statement within the where clasue.
I am wondering what the proper syntax or solution would be for the code listed below. The issue seems to be passing multiple ID's when the location is 99999
Code: Select all
WHERE
LOC.LOC_ID IN(
CASE
WHEN @LOCATION = '99999' THEN 12345, 12346, 12347
ELSE @LOCATION
END)
I'm beginning to wonder now if it is better to use boolean logic instead?