Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2007
    Location
    Auckland New Zealand
    Posts
    120
    Provided Answers: 1

    Unanswered: IN/ NO IN Clause with Case

    Why Won't this Work in a where condition and How do I Make it Work? or Get the same logic? trying to not make the condition even more complex with lots of case when's ,

    Response.Action NOT IN
    CASE WHEN @RepliedCondition = 1 THEN ('A') ELSE ('O','N','P') END

  2. #2
    Join Date
    Aug 2007
    Location
    Auckland New Zealand
    Posts
    120
    Provided Answers: 1
    Sorry Got it

    ((@RepliedCondition=1 AND Response.Action NOT LIKE 'A') OR
    (@RepliedCondition=0 AND Response.Action NOT IN('O','N','P'))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •