• lanky_doodle - Wednesday, February 28, 2018 8:16 AM

    Hello,

    I'm doing this:


    ...
    union
    select  'EVY', 'Everyone', ...
    from  ...
    where  ... and @Grouping = 'false'

    That @Grouping = false still returns the row if the value is true. I've worked out because I'm using constant values - 'EVY', 'Everyone' - instead of column values. If I change to column values it works as expected.

    How can I use constant values this way?

    Thanks

    The only way that 'EVY', 'Everyone' will return is if the WHERE clause evaluates to TRUE, so the value of @Grouping must be 'false'.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA