Forum Discussion
MCFNeil
Qrew Captain
Try something like this (this will handle if its submitted ON the weekend. (starting point, I'll have to come back to deduct the weekend time if its submitted on a Monday kind of thing)
var date SubDateOnly=ToDate([Date/Time Submitted]); //convert date/time to date
var datetime NewSubmitted=ToTimeStamp(ToWeekdayP($SubDateOnly), ToTimeOfDay("11:59 pm")); //create a friday night at midnight timestamp
var datetime AdjustedSubmitted=If(IsWeekday($SubDateOnly), [Date/Time Submitted]), $NewSubmitted); //If its a weekday, use the regular timestamp, otherwise use the friday night time.
$AdjustSubmitted-[Date Created] //put it all together
If your submittals are never greater than a week, then you could add some conditional logic to evaluate the start and end, and if the total is greater than x number (i.e. it includes a weekend time) subtract that 48 hours.
var date SubDateOnly=ToDate([Date/Time Submitted]); //convert date/time to date
var datetime NewSubmitted=ToTimeStamp(ToWeekdayP($SubDateOnly), ToTimeOfDay("11:59 pm")); //create a friday night at midnight timestamp
var datetime AdjustedSubmitted=If(IsWeekday($SubDateOnly), [Date/Time Submitted]), $NewSubmitted); //If its a weekday, use the regular timestamp, otherwise use the friday night time.
$AdjustSubmitted-[Date Created] //put it all together
If your submittals are never greater than a week, then you could add some conditional logic to evaluate the start and end, and if the total is greater than x number (i.e. it includes a weekend time) subtract that 48 hours.
MCFNeil
6 years agoQrew Captain
I just did this one for an internal project. It shows the number of weekdays from the start to closure and a running total if its not closed yet.
var datetime Start=[Approved On];
var datetime End=If(IsNull([Completed / Closed On]), Now(), [Completed / Closed On]);
var date SDate=ToDate($Start);
var date EDate=ToDate($End);
var number NumberOfDays=WeekdaySub($EDate, $SDate);
Days($NumberOfDays)
var datetime Start=[Approved On];
var datetime End=If(IsNull([Completed / Closed On]), Now(), [Completed / Closed On]);
var date SDate=ToDate($Start);
var date EDate=ToDate($End);
var number NumberOfDays=WeekdaySub($EDate, $SDate);
Days($NumberOfDays)