What I want to achieve is really simple. I have a Select statement where there is a parameter @ageconnected to a DropDownList. The @age parameter is used for the AGE column.
Now this DropDownList has a default value ALL, that when selected has to display any value in AGE column. Here is my logic:
SELECT * FROM tableaGE
where ([AGE] = CASE WHEN @Age = 'ALL' THEN ??? ELSE @Age END)
I cannot find documentation on the Internet on this topic. What shall I put instead of the ???. I tried with * but it gives syntax error. Thanks
It was really simple, just place the name of the field instead of ???