Select * from MyTable
where myField = 1
And myImportantField ???
...
i have following parameters :
@DoCalculateValues bit,
@FromValue int,
@ToValue int
I NEED THIS
if @DoCalculateValues = 1 then
check if myImportantField is between @FromValue and @ToValue
else
ignore values, something like "And myImportantValue = myImportantValue"
please consider that this is all happening in the middle of a “… WHERE … AND …” clause
1 Answer