I am trying to display seconds as minutes. Sometimes the value I get is negative. This causes problems. I wanted to check if the value is negative so that I can assign a default value. But I can not get If and Format statement work together.
This is what I have done to display the values without converting into minutes:
=Fields!RateLossSeconds.Value
This is what I have done to convert the seconds into minutes:
=Format(DateAdd("s", Fields!RateLossSeconds.Value, "00:00"), "mm:ss")
This is the code I used to add a condition:
=IIF(Fields!RateLossSeconds.Value < 0, 0, Format(DateAdd("s", Fields!RateLossSeconds.Value, "00:00"), "mm:ss"))
As you can see the if statement does not work as desired.
Aucun commentaire:
Enregistrer un commentaire