Forum Discussion
QuickBaseCoachD
8 years agoQrew Captain
:)
Right, I missed that ...
If(
$isSunday,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),2),ToTimeOfDay("8 pm"))),
$isSaturday,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),3),ToTimeOfDay("8 pm"))),
$isFriday and $isFridayEightPM,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),4),ToTimeOfDay("8 pm")),
$isFriday and not $isFridayEightPM, ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time])),2)),ToTimeOfDay([Date Time])))
)
There may be unbalanced brackets. I did not try to reconcile the closing ))) at the end of each line.
Note that with Quick Base, unlike Excel, you do not need to next your IFs. You can just start with one IF( and then list all your tests and results below in sequence.
That last ) at the end by itself is the closing to the beginning ( of the IF.
Right, I missed that ...
If(
$isSunday,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),2),ToTimeOfDay("8 pm"))),
$isSaturday,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),3),ToTimeOfDay("8 pm"))),
$isFriday and $isFridayEightPM,ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time]))),4),ToTimeOfDay("8 pm")),
$isFriday and not $isFridayEightPM, ToTimestamp(ToDate(WorkdayAdd(ToWorkDate(ToDate([Date Time])),2)),ToTimeOfDay([Date Time])))
)
There may be unbalanced brackets. I did not try to reconcile the closing ))) at the end of each line.
Note that with Quick Base, unlike Excel, you do not need to next your IFs. You can just start with one IF( and then list all your tests and results below in sequence.
That last ) at the end by itself is the closing to the beginning ( of the IF.
RachelJones
8 years agoQrew Cadet
I was having trouble understanding how to format multiple if/then statements. I tried without nesting the ifs and the syntax worked but the logic was wrong. I will try again, but my biggest issue is that I am trying to check sequentially first, is it friday after 8pm? Then if it's not, i want to know if it's friday at all (before 8pm). Finally if neither of those are true, i want to check for the other conditions. That's why nested ifs make sense to me but the other structure was confusing.
I did not know I could do "and not". That is exactly what I needed. Thanks. I think this is the missing link.
I did not know I could do "and not". That is exactly what I needed. Thanks. I think this is the missing link.