"Value is not a boolean" error for filter based on a boolean ... what value should I use for True?

  • I'm using a Filter for the first time.

    In the Dataset Properties dialog box in the Filters tab I clicked on Add then selected the field I want to filter on from the Expression dropdown list. SSRS recognizes the field as a Boolean. (The field is defined as BIT, NOT NULL in the source table.)

    The Operator is "=".

    In the Value field I've tried 1, "1", 0, True, "True", YES, and "YES". Each of them causes a dialog box to pop up saying "<Value>

    Value is not a boolean."

    What value should I use for a boolean in this context?

    Thanks in advance for any assistance.

    Christian Bahnsen

  • Remember that bit is not boolean, so you have to compare it to 1.

    e.g. bit_field = 1

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Hopefully you'll be able to see the screenshot I uploaded.

    I've come up with a workaround using expressions, but to my mind the approach shown in the screenshot SHOULD work.

    I'm going to write it off to an idiosyncracy.

    Chris

  • That's the problem we face when SQL Server does not use the same datatypes for all of its tools.

    the value you're looking for should be: true (with no quote marks).

    I'm relatively new to SSRS too, but I'm using 2008 and it works fine.

    Luis C.
    General Disclaimer:
    Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?

    How to post data/code on a forum to get the best help: Option 1 / Option 2
  • Good job!

    I tried using True yesterday but it kept throwing the error.

    Today when I use True (it's not case sensitive because I tested true, True, TRUE) SSRS accepted the Value.

    Go figure.

    Thanks again

Viewing 5 posts - 1 through 4 (of 4 total)

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