Color Coding

  • =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.

  • 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
    )

  • 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.

  • 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