I would like to search between to columns in a s query or a table depending on the variable on a paramenter e.g
Declare @SelectAll as interger
Set @SelectAll = 1
Declare @Column as interger
Select mt.Column1, mtColumn2
From MyTable as mt
Where Case When @SelectAll = 1 Then
mt.Column1 IN(@Column) and mt.Column2 (' Selecting all")
When @SelectAll = 1 Then
mt.Column2 IN(@Column) and mt.Column1 (' Selecting all")
End
The purpose of this query is to allow the user to search between the column they choose. Further more the use of parameter is for the purposes of writing reporting services reports.