Well now I have come across something very odd. I have done the following code for a sanity check:
//Declare the variables so the hours can be changed later if needed
var duration samshrs = Hours(12);
var duration walmarthrs = Hours(8);
var TimeOfDay samsclose = ToTimeOfDay("7:00pm");
var TimeOfDay samsopen = ToTimeOfDay("9:00am");
var TimeOfDay walmartclose = ToTimeOfDay("11:00pm");
var TimeOfDay walmartopen = ToTimeOfDay("6:00am");
var TimeOfDay initialTime = ToTimeOfDay([Work Order Request Received Date/Time Corrected] + [Duration Counter]);
var bool samsClosed = $initialTime >= $samsclose and $initialTime < $samsopen;
var bool walmartClosed = $initialTime >= $walmartclose or $initialTime < $walmartopen;
If($walmartClosed, true, false)
and I alternatively put, (ToTimeOfDay([Work Order Request Received Date/Time Corrected] + [Duration Counter]) >= $walmartclose) in prior to this, but for some odd reason the system does not view 2:15am as past the closing time of 11pm, perhaps its because its the next day. This caused your clean up to not work. I like the format of the code for readability as you said, but I am unable to use an "and" logic function due to this. How could I resolve this issue?
------------------------------
William Hunter
------------------------------