Following is the Code I am trying
In all total I want to use different Columns in where clause depending upon the value I pass to the variable.
Can it be done with Case Statement?
Code:
Declare @Day Int Set @Day=1 Select Mobile, Contact As Name, InTimeDay1 From uvw_UserDetails Where Case When @Day=1 Then Day1=1 When @Day=2 Then Day2=1 When @Day=3 Then Day3=1 When @Day=4 Then Day4=1 When @Day=5 Then Day5=1 End
Can it be done with Case Statement?
Comment