Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 Reporting Services Development
 IIF Statement

Author  Topic 

Tonic
Starting Member

26 Posts

Posted - 2006-05-24 : 00:58:41
I am just trying to do some maths on my report and thought I would use the IIF statement to do the work. The problem I have is that all of the searches I have done on the net seem to revolve around finding values that = rather than not equal. Obviously if this was a number I was searching on I could use;

=IIF(ReportItems!DataRow2_Floorspace_Total.Value<>0,(ReportItems!DataRow2_Floorspace_Occupied.Value)/(ReportItems!DataRow2_Floorspace_Total.Value),0)

but what is the SSRS expression equivelant of <> when it comes to searching for something that is <> "Vacant" as an example.

Using <> just throws up an error which I guess I would expect as it is not a numerical value I am searching for.

Regards


Toni C
aka Talisa

dfiala
Posting Yak Master

116 Posts

Posted - 2006-05-24 : 06:19:02
You can use the Not operator

=IIF(Not(ReportItems!DataRow2_Floor = "Vacant"),1,0)

These should all be valid operators in the Report Expression syntax...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vaidxLogical.asp

Dean Fiala
Very Practical Software, Inc
Now with Blogging...
http://www.vpsw.com/blogbaby
Microsoft MVP
Go to Top of Page

Tonic
Starting Member

26 Posts

Posted - 2006-05-24 : 06:23:01
Excellent, thank you

Regards


Toni C
aka Talisa
Go to Top of Page
   

- Advertisement -