Discussions

 View Only
  • 1.  Formulas Help

    Posted 06-14-2020 20:14
    Hello, I am trying to get a checkbox to indicate if a vendor is open or closed. I have imputed the vendor times so my variables are like Monday start time, Monday end time ect. The only thing I have figured out is how to get duration. Any help would be great. Thank you

    ------------------------------
    Efren Torres
    ------------------------------


  • 2.  RE: Formulas Help

    Posted 06-14-2020 20:21
    Can you elaborate? Your question refers to a checkbox and then at the end a duration.  Perhaps an example would help.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Formulas Help

    Posted 06-14-2020 20:46
    Yes I am making the mistake of trying to do like [Monday start time} - [Monday end time]. This gives me a duration. Thats not what I need at all so Im lost. I need the checkbox to change based on weather the current time is between the start and closed time and also be able to change day to day

    ------------------------------
    Efren Torres
    ------------------------------



  • 4.  RE: Formulas Help

    Posted 06-14-2020 22:07
    So to be clear, do you want to check if the current time is between those start and end times, or if the time in a field or perhaps the date time that the record was created was during the open times?  I have given a formula below to give you what you asked for, but it may not be what you need. :)

    Also, I am not sure what you want to do on weekends? Are you also open on Saturday and Sunday?

    var timeofday Time  = ToTimeOfDay(Now());
    var number DayNumber = DayOfWeek(Today());

    $DayNumber = 1 and $Time >= [Monday start time] and and $Time <= [Monday end time]
    or
    $DayNumber = 2 and $Time >= [Tuesday start time] and and $Time <= [Tuesday end time]
    or
    $DayNumber = 3 and $Time >= [Wednesday start time] and and $Time <= [Wednesday end time]
    or
    $DayNumber = 4 and $Time >= [Thursday start time] and and $Time <= [Thursday end time]
    or
    $DayNumber = 5 and $Time >= [Friday start time] and and $Time <= [Friday end time]
    or
    $DayNumber = 6 and $Time >= [Saturday start time] and and $Time <= [Saturday end time]
    or
    $DayNumber = 0 and $Time >= [Sunday start time] and and $Time <= [Sunday end time]



     


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Formulas Help

    Posted 06-15-2020 00:09
    Edited by Efren Torres 06-15-2020 00:10
    First off Thank you for your help! Second, we are open 24/7 and I want the check box to check if it is between the start and end time and not check the box outside of the start and end time. I also want it to take into account the day of the week because if the vendor is closed on the weekends I dont want the checkbox to be checked either. I was trying to use if statements but from your formula it looks like I wasn't even close. 

    As far as the formula you did post I got an error(expecting Bool) on line 4 after the second AND

    ------------------------------
    Efren Torres
    ------------------------------



  • 6.  RE: Formulas Help

    Posted 06-15-2020 00:19
    Please post your formula and the error message when you saved.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 7.  RE: Formulas Help

    Posted 06-15-2020 00:20
    Oh, remove one if the double and and in each line


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 8.  RE: Formulas Help

    Posted 06-15-2020 00:29
    Perfect! that worked

    ------------------------------
    Efren Torres
    ------------------------------