Discussions

Expand all | Collapse all

How do I get my date formula to stop at zero?

  • 1.  How do I get my date formula to stop at zero?

    Posted 07-12-2018 14:30
    So here is my current formula: WeekdaySub (ToDate([Training Start Date]), Today())

    Once we're past the Training Start Date it calculates negative values, however I would like to stop it at 0 since there has been a request to add a notification.

    I've played around with the formula (adding a ,0) but just cannot seem to get it to work.

    Thanks in advance for the help!


  • 2.  RE: How do I get my date formula to stop at zero?

    Posted 07-12-2018 17:40
    Ron, you just need an if formula to set it to zero when it goes negative.  See the following as an example.

    var number daysTillTraining =  WeekdaySub(ToDate([Training Start Date]), Today()); If ( $daysTillTraining < 0 ,0 ,$daysTillTraining )


  • 3.  RE: How do I get my date formula to stop at zero?

    Posted 07-12-2018 23:41
    Alternatively

    Max(0, WeekdaySub (ToDate([Training Start Date]), Today()))

    If the calculated value is less than zero then the 0 will be the "Max"

    same result as what Forrest posted.


  • 4.  RE: How do I get my date formula to stop at zero?

    Posted 07-17-2018 19:27
    Apologies for the delay in responding - finally got around to applying the formula this morning and it works beautifully.  

    Can't thank you enough for the help as I go through and try to fine-tune the app, based on user responses/feedback.  You folks make me look like a hero to them and for that, I can't thank you enough.