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
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Change field color based on dataset value

Author  Topic 

skalra
Starting Member

20 Posts

Posted - 2009-01-21 : 15:36:48
Hi,

I want to change the color of the textbox based on the dataset value when the date value is null or nothing.

I am using the following code on the BG property of textbox but it is not changing the color for null values:

=IIF(Datediff("yyyy",Fields!fieldname.value,Now())>1,"Red",iif(Datediff("yyyy",Fields!fieldname.value,Now())<1 OR Datediff("yyyy",Fields!fieldname.value,Now())= nothing,"Black","White"))

the first two condition are working finr but when i am using for null values it is not working.

Please help
Regards,
Skalra

revelator
Starting Member

32 Posts

Posted - 2009-01-22 : 04:45:12
Try this...

=IIF(Datediff("yyyy",Fields!fieldname.value,Now())>1,"Red",iif(Datediff("yyyy",Fields!fieldname.value,Now())<1 OR IsNothing(Datediff("yyyy",Fields!fieldname.value,Now())),"Black","White"))



-----------------------------------
Waiting for the Great Leap Forwards
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-23 : 12:52:48
you can also switch() instead of nested iif

http://www.keirgordon.com/2007/08/sql-reporting-services-switch-statement.html
Go to Top of Page
   

- Advertisement -