You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Case Statement”.
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Case Statement”.
is there any limitation of the number of case statements that we can use in one select statement.
thanks…
Hi Sema, no there is not.
Good luck,
Derek
Name =
Case @searchString
when ‘ ‘ then Not SurvUserHier.EmpId
When ‘eq’ then SurvUserHier.EmpId
end)
I want to use NOT in the then, but its giving error any suggestions
Hi Jasvinder,
In that case (hehe).. you need to break the case statement out.
Name =
Case when @searchString = ‘eq’ THEN SurvUserHier.EmpId END
You don’t need an ELSE.
Hi!
I wonder if you can help me with a convert problem in a case expression?
The result would be like..
name, customer
Anna, 5
Hans, 10
Curt, No customer
I must make an convert in the case, and here is my code…
WHEN COUNT( k.customer) = 0 THEN ‘No customer’
ELSE COUNT(CONVERT(char(20),CONVERT(int, k.customer)))
What is wrong!
Please help!
Hans Fransson // Sweden