Flagging Time that is After Core Business Hours

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I would like to create a flag variable that identifies when an activity starts either before or after core business hours. I have created a variable that identifies the "day."  So, Monday-Friday, anything before 7am or after 6pm flag as "yes" and anytime on Saturday or Sunday I'd like flagged as "yes." Otherwise, flag as "no." I started with something simple using a formula-text field, brief syntax below, but I get errors about mismatched brackets, parenthesis, or quotes. 

If(


  [Date Engaged Day] = "Monday"  and [Time ESG Engaged]<= 7:00, "Yes",

  [Date Engaged Day] = "Monday"  and [Time ESG Engaged]>= 18:00, "Yes", "NO"

  )
Photo of Anne

Anne

  • 100 Points 100 badge 2x thumb

Posted 3 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 69,884 Points 50k badge 2x thumb
Try this

var number DayNumber  = DayOfWeek([My Date Field]);

IF(

$DayNumber = 6, "Yes",  // Saturday

$DayNumber = 0, "Yes", // Sunday

[Time ESG Engaged] < ToTimeOfDay("7:00 am"), "Yes",


[Time ESG Engaged] > ToTimeOfDay("6:00 pm"), "Yes", "No")




I am assuming here that the field [Time ESG Engaged] is of type TimeOfDay field.