Forum Discussion

RobSalaj's avatar
RobSalaj
Qrew Cadet
5 years ago

TimeofDay Formatting

I have a TimeOfDay field using 24 hour clock to track incidents. I simply would like to identify any time entered

between 00:00 to 10:00 = "Morning"
Between 10:01 to 13:00 = "Mid-day"
Between "13:01 to 17:00" = "Afternoon"
Between "17:01 to 24:00 = Evening

I am having trouble with the TimeofDay formula and Text formulas to use If/Case. Any ideas?
Thanks

------------------------------
Rob Salaj
------------------------------
  • not tested but try this


    var TimeOfDay TOD = [My time of day field];

    IF(
    $TOD >  ToTimeOfDay("12:01am") and $TOD <=  ToTimeOfDay("1:00 pm"), "Morning"
    $TOD >  ToTimeOfDay("1:00 pm") and $TOD <=  ToTimeOfDay("5:00 pm"), "Afternoon",
    $TOD >  ToTimeOfDay("5:00 pm") and $TOD <=  ToTimeOfDay("12:00 am"), "Evening",
    IsNull($TOD, "", "Other")


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------
    • RobSalaj's avatar
      RobSalaj
      Qrew Cadet
      A few syntax errors. but it worked! got me to where i can take it. Thanks!!

      ------------------------------
      Rob Salaj
      ------------------------------