Select * from table1 where Case @periode When 1 Then Case when condition = 1 Then 1 Else 0 End When 2 Then Case when condition = 2 Then 1 Else 0 End Else 0 End = 1