Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Evaluating bit fields in SSRS Expand / Collapse
Author
Message
Posted Tuesday, June 4, 2013 8:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 9:31 AM
Points: 4, Visits: 65
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?
Post #1459800
Posted Tuesday, June 4, 2013 8:36 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:36 PM
Points: 12,965, Visits: 32,539
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1459804
Posted Tuesday, June 4, 2013 9:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 9:31 AM
Points: 4, Visits: 65
It is a boolean so I would imagine this is then evalutating IsState.Value <> False?
Post #1459820
Posted Tuesday, June 4, 2013 9:22 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Yesterday @ 3:36 PM
Points: 12,965, Visits: 32,539
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1459822
Posted Tuesday, June 4, 2013 9:28 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 20, 2014 9:31 AM
Points: 4, Visits: 65
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.
Post #1459826
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse