Skip to main content
Question

Status field for a duration not working properly

  • August 29, 2017
  • 0 replies
  • 20 views

I have a duration field called [Contract Down Time]. I would like to put a status on this that would return "Downtime Reported" if there is a value in the field, and "No Downtime" if the field was left blank. I thought I knew how to do this, but it's not working. I have the following formula in the status field:

If(ToText([Contract Down Time])<>"",

"<div class='" & "<b>" & "Downtime" & "</b>" & "' style='padding: 3px 5px; background: #" & "FF1493" & " ; border-radius: 8px; text-align: center; text-decoration: none'>" & "<b>" & "Downtime Reported" & "</b>" & "</div>",

"<div class='" & "<b>" & "No Downtime" & "</b>" & "' style='padding: 3px 5px; background: #" & "E0E0E0" & "; border-radius: 8px; text-align: center; text-decoration: none'>" & "<b>" & "No Downtime" & "</b>" & "</div>"

)


However when I look at one record with downtime and another without, they both have the status "Downtime Reported"

Can someone help me figure out what I have done wrong on this?

Thanks!
This topic has been closed for replies.

  • Registered
  • August 29, 2017
Try to use the IsNull function rather than the <>"".

If(IsNull([Contract Down Time]),

If the field properties for the duration field have "treat blank values as '0' in calculations" it will cause your <>"" to have the value of 0, so its not ever blank.

  • Registered
  • August 30, 2017
To confirm, If they 'report' 0 days or 1000 days, you want the status to be "Downtime Reported"?

But if its blank you want it to be "no downtime"?

Or if its Zero is should be "no downtime"?