Nahid Sultana Tithi
Nahid Sultana Tithi

Reputation: 27

Conditional Formatting in SSRS

I am a bit new with SSRS, I need to do a conditional formatting in SSRS, where if the last_backup_date is less than 3 days, the column will be "Yellow" and if it is less than 7 days, then the column will be "Red"... I can't figure out how to do this. Any help would be appreciated. I tried using Switch function but just can't figure out which Date & Time function to use here. Thanks in advance

Upvotes: 1

Views: 526

Answers (1)

alejandro zuleta
alejandro zuleta

Reputation: 14108

Try using this:

=Switch(
DATEDIFF(DateinterVal.Day,Fields!last_backup_date,Today())<3,"Yellow",
DATEDIFF(DateinterVal.Day,Fields!last_backup_date,Today())<7,"Red"
)

Update

Adding an additional condition based on comments.

=Switch(
DATEDIFF(DateinterVal.Day,Fields!last_backup_date,Today())<3,"DarkGreen",
DATEDIFF(DateinterVal.Day,Fields!last_backup_date,Today())<=7,"Yellow",
true,"Red"
)

Upvotes: 1

Related Questions