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

  • 0
  • 1
  • Question
  • Updated 1 year ago
  • Answered
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!
Photo of Ron


  • 300 Points 250 badge 2x thumb

Posted 1 year ago

  • 0
  • 1
Photo of Forrest Parker

Forrest Parker

  • 1,332 Points 1k badge 2x thumb
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());
$daysTillTraining < 0

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.
Photo of Ron


  • 300 Points 250 badge 2x thumb
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.