AnsweredAssumed Answered

Script to replace calculated value when conditions met

Question asked by Teague on Aug 2, 2010
Latest reply on Aug 4, 2010 by philmodjunk


Script to replace calculated value when conditions met


Hi, I would love a hand with what is likely not a challenging problem but for some reason, I just can't get it right.

I have two time variable that I would like to subtract to provide a calculated duration variable that I would prefer to output in minutes only but is currently producing an "hour:minute:second" calculation:

D2B_time = Mod (Balloon_time - Door_time + 86400; 86400)

However, sometimes there is no Balloon_time. In these situations, I have been entering the Balloon_time as 0 but the D2B_time product is an incorrect set of hours and minutes that is throwing off my data set. I would like to write a script that sets the D2B_time to "0"  (or clears the field or something similar) in this situation. My script current attempt at this script  is:

Set Field By Name[If (Activation_Events::Balloon_time = "0";
Activation_Events::D2B_time; 0)]

but this seems to do nothing at all. I have also been playing with setting the script trigger but that hasn't helped.

Any input would be greatly appreciated as I clearly over my head a little.

Thanks much!