SSRS Expressions background color

  • Good day experts,

    i have a task to set back ground color to my table.the conditions are if Column LastydiffBackupdate is less 2 days then color the column green.If more than two days color red, here is the code which worked fine.=IIf(DateDiff("d",Fields!LastDiffBackupDate.Value, Today())<2,"Green","Red")

    now i must set another colour experssion to the same column for if it is null then no color.

    My question is how can i add another iff statement to the one above.

    I am trying this this not working =IIf(DateDiff("d",Fields!LastDiffBackupDate.Value, Today())<2,"Green","Red") OR IIf(IS Nothing(Fields!LastDiffBackupDate.Value),"Transparent").

    Please help!!

  • the usual way of dealing with a series of IIF statements is nesting them... Here's the barebones structure (which you've sorted out)

    =IIF(<test>,<true part>,<false part>)

    In your case, I think you want something like this:

    =IIF(<test1>,<true part1>,IIF(<test2>,<true part 2>,<false part 2>))

    In other words, the second test is in the place of <false part 1>.

  • Thank you i will try that.So it must be like

    =IIf(DateDiff("d",Fields!LastDiffBackupDate.Value, Today())<=2,"Green", IIf(IS Nothing(Fields!LastDiffBackupDate.Value),"Transparent","Red")).

    Below are the conditions which must be satisfied by the expression

    1.if the column lastdiffbackupdate value is within last two days then color green or else red meaning the red will only apply if the lastbackupdiffdate is within three days and above.

    2.if that same column again is null then the color must be transparent because i have other databases that do not do Diff backups at all.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply