SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
Christian Bahnsen
Christian Bahnsen
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 161
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
Luis Cazares
Luis Cazares
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17468 Visits: 19122
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
Christian Bahnsen
Christian Bahnsen
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 161
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
Attachments
ssrs_filter_problem.JPG (51 views, 44.00 KB)
Luis Cazares
Luis Cazares
SSCoach
SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)SSCoach (17K reputation)

Group: General Forum Members
Points: 17468 Visits: 19122
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
Christian Bahnsen
Christian Bahnsen
SSC-Enthusiastic
SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)SSC-Enthusiastic (147 reputation)

Group: General Forum Members
Points: 147 Visits: 161
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search