Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
Try this
var date RawDate = If([Category] = "PNP", WeekdayAdd([Equip Reqd By],-21),
WeekdayAdd([Equip Reqd By],-14));
LastDayOfPeriod($RawDate, Weeks(1),Date(2017,5,20))
What does is to take the Period starting on a Saturday (it does not matter which Saturday) and based on a period length of 1 week, it calculates the Last Day of the Period, which of course must be a Friday if the 1 week period starts on a Saturday.
var date RawDate = If([Category] = "PNP", WeekdayAdd([Equip Reqd By],-21),
WeekdayAdd([Equip Reqd By],-14));
LastDayOfPeriod($RawDate, Weeks(1),Date(2017,5,20))
What does is to take the Period starting on a Saturday (it does not matter which Saturday) and based on a period length of 1 week, it calculates the Last Day of the Period, which of course must be a Friday if the 1 week period starts on a Saturday.