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
 Boolean Iif and AND allowed?? SSRS2000

Author  Topic 

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-06-10 : 11:25:01
I'm creating a variable with the following expression:

=Iif( Fields!Dir_Mgr.Value = " " AND
Fields!Department.Value = "Health Advisors",
"Gail Harries", Fields!Dir_Mgr.Value)

However, I'm getting error msg:

The value expression for the field ‘=Iif( Fields!Dir_Mgr.Value = " " AND
Fields!Department.Value = "Health Advisors",
"Gail Harries", Fields!Dir_Mgr.Value)’ contains an error: [BC30455] Argument not specified for parameter 'TruePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

I thought the syntax was correct. Or is it because IIF and AND?

thx,

john

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-10 : 11:38:30
I cant find any obvious errors in your expression. Are you sure this is full expression used? Also where are you using it? Is this inside some table or matrix?
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-06-10 : 13:31:24
That's the exact syntax I'm using. I'm using it inside a table in a group header line. Also, the field: Fields!Dir_Mgr.Value is another variable whose syntax is

=Iif( Fields!MgrTitle.Value = "DIRECTOR" OR Fields!MgrTitle.Value = "MANAGER", Fields!Supervisor.Value, " ")
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-10 : 13:41:52
quote:
Originally posted by latingntlman

That's the exact syntax I'm using. I'm using it inside a table in a group header line. Also, the field: Fields!Dir_Mgr.Value is another variable whose syntax is

=Iif( Fields!MgrTitle.Value = "DIRECTOR" OR Fields!MgrTitle.Value = "MANAGER", Fields!Supervisor.Value, " ")


DIdnt get that. DId you mean Dir_Mgr is a cell within some table or is it available within your dataset?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-10 : 13:50:51
I think he means it's a calculated field.

Cross-post: http://www.sqlservercentral.com/Forums/Topic514553-1063-1.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-10 : 13:54:00
quote:
Originally posted by tkizer

I think he means it's a calculated field.

Cross-post: http://www.sqlservercentral.com/Forums/Topic514553-1063-1.aspx

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



If its a field calculated in report, it wont be available in Fields collection. Then OP needs to access it from ReportItems collection.
Go to Top of Page

latingntlman
Yak Posting Veteran

96 Posts

Posted - 2008-06-11 : 11:42:26
Yes, it is a calculated field, and the expression is a boolean.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-06-11 : 13:01:24
quote:
Originally posted by latingntlman

Yes, it is a calculated field, and the expression is a boolean.


then you cant acces it as Fields! you need to access it by Reportitems!{textboxname}.value
Go to Top of Page
   

- Advertisement -