Skip to content
 

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”.

5 Comments

  1. sema says:

    is there any limitation of the number of case statements that we can use in one select statement.
    thanks…

  2. Jasvinder says:

    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

  3. Hans Fransson says:

    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

post a comment OR Post Your Question on our ASK! Community!