Hi William,
If it were me, I'd likely make a few more variables to improve readability and make it easier to test. The syntax issue you're having might be the extra If() -- Formulas in QB essentially take the format: If, Then, If, Then...,,Else. You might have to play around with this a bit, but here's a start:
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 Recieved Date/Time] + [Duration Counter]);
var bool samsClosed = $initialTime >= $samsclose and $initialTime < $samsopen;
var bool walmartClosed = $initialTime >= $walmartclose and $intialTime < $walmartopen;
If(Project Site - Store Type] = "Retail (Walmart)" and $walmartClosed,
TIME or DATETIME CALC YOU WANT,
[Project Site - Store Type] = "Wholesale (Sam's Club)",
TIME or DATETIME CALC YOU WANT
)
Do you want the field to resolve to be the $initialTime if the store is open and the next opening time if the store is closed? Or is the result a Date/Time?
------------------------------
Chris Wheatley
------------------------------