Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Evaluating bit fields in SSRS


Evaluating bit fields in SSRS

Author
Message
dawidajm
dawidajm
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 109
Can SSRS evaluate a bit field without having to specify the comparison?

Example: =IIF( Fields!IsState.Value and Fields!RegionID.Value <>"12","Yes","No")

In this example IsState is a bit field and is not being compared to a value like RegionID is being compared to "12". Is this statement saying if IsState and RegionID is not equal to 12 then Yes else No. Or is IsState automatically being evaluated again "True" since nothing is explicitly specified to evaluate against it?
Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14984 Visits: 39008
i believe this is the equivalent; the first test is evaluating whether it's boolean, so the first part of your test is just checking if the value is zero or non zero:

Example: =IIF( Fields!IsState.Value <> 0 and Fields!RegionID.Value <>"12","Yes","No")


Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

dawidajm
dawidajm
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 109
It is a boolean so I would imagine this is then evalutating IsState.Value <> False?
Lowell
Lowell
SSChampion
SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)SSChampion (14K reputation)

Group: General Forum Members
Points: 14984 Visits: 39008
dawidajm (6/4/2013)
It is a boolean so I would imagine this is then evalutating IsState.Value <> False?


i believe under the covers , false is zero, and true is anything not zero, right? so there;s some implicit conversions going on to get it to fit into a boolean datatype.

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

dawidajm
dawidajm
Forum Newbie
Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: General Forum Members
Points: 4 Visits: 109
Lowell (6/4/2013)
dawidajm (6/4/2013)
It is a boolean so I would imagine this is then evalutating IsState.Value <> False?


i believe under the covers , false is zero, and true is anything not zero, right? so there;s some implicit conversions going on to get it to fit into a boolean datatype.


False is zero and true is 1. I don't think it can be anything outside of 1 and still evaluate to true.
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