May 3, 2018 at 1:21 am
=iif((Fields!DBName.Value <> "tempdb" OR (Fields!State_desc.Value = "ONLINE"
AND IsNothing(Fields!Physical_device_name.Value) AND DateAdd("d", 1, Fields!Last_db_backup_date) < Now(),"Orange", "LightGreen"))
I have this piece of code on Background Color for Last_db_backup_date column which is not working, no errors but the Last_db_backup_date column is all white for the entire report.
Conditions:
If DBname is temp Db (then the entire row is in LightGreen)
OR
(
If State_Desc is ONLINE AND If Physical_device_name has a value AND If Last_db_backup_date is less than 24 hrs
- then entire row in LightGreen else Orange
What I need is:
The entire row should be in Lightgreen for the whole report if all the conditions satisfy but the row should be in Orange even if one of the condition fails.
May 3, 2018 at 4:31 pm
The IIF statement doesn't look like it follows the conditions, but it's hard to be sure. You have an OR in your conditions that could parse a couple of different ways. Is it like this (note the parentheses):(
If DBname is temp Db (then the entire row is in LightGreen)
OR
If State_Desc is ONLINE
)
AND
If Physical_device_name has a value( E:\Backup\ABC.bak)(if there is no value then in Orange)
AND
If Last_db_backup_date is less than 24 hrs
then entire row in LightGreen else Orange
Or is it:If DBname is temp Db (then the entire row is in LightGreen)
OR
(
If State_Desc is ONLINE
AND
If Physical_device_name has a value( E:\Backup\ABC.bak)(if there is no value then in Orange)
AND
If Last_db_backup_date is less than 24 hrs
then entire row in LightGreen else Orange
)
May 4, 2018 at 1:00 am
I have update my query.
=iif((Fields!DBName.Value <> "tempdb") OR Fields!State_desc.Value = "ONLINE"
AND IsNothing(Fields!Physical_device_name.Value) AND DateAdd("d", 1, Fields!Last_db_backup_date) < Now(),"Orange", "LightGreen")
Can you please check if the reasoning and query match.The code is still not working.The whole column where I have used this code is white.I have used the code for background color for the last_db_backup_date column.
May 10, 2018 at 3:05 am
This was removed by the editor as SPAM
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply