SSRS Switch Statement

  • Hello, does anyone know of a way to use "IN" or something comparable in a switch statement?

    Thanks

  • An "IN" statement like in TSQL can be written by a series of logical ORs.

    myColumn IN (1,2,3)

    equals to

    myColumn == 1 OR myColumn == 2 OR myColumn == 3

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Are you looking for something like this?

    SELECT

    A = CASE

    WHEN B IN (1,2,3) THEN 1

    ELSE 0

    END

    ...

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply