Skip to main content
Question

Countdown days until a specified date

  • March 9, 2018
  • 0 replies
  • 354 views

So I have two fields: the first is a projected 'delivery date' and the second is a 'how many days until delivery" (essentially, its a countdown).  On the Days-Until-Delivery field I have the following formula:

ToDays([Projected Launch Date] - Today())

And it works great. Problem is, after it reaches the due-date, it starts to show a negative value.  I would like it to simply 'zero' out once the due-date is achieved (I already have it set-up to show any records that are past the due-date to be highlighted in red). Any suggestions on how to code this out?

Thanks in advance for your help.
This topic has been closed for replies.

if you want a zero, this this will work

Max(ToDays([Projected Launch Date] - Today()),0)

That way it will never go below zero.

But if you want null (blank) then it would be

var number Countdown = ToDays([Projected Launch Date] - Today());

IF($Countdown >0, $Countdown)