Help

Re: Function TODAY() not always giving the exact output when used with compare symbols "<" or ">" to compare dates

1427 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Christian_Heins
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi!

I had the following situation when using the following formula to compare dates and determine the current row as the current date.

  • the first part state if the count I less or equal to 1, that’s the current row,

  • then if the count is above 1 and now is greater than the start date and now is previous to next date or next date is empty, that’s the current row

IF({Count}<=1, “current”, IF(AND({Count}>1, Now() > {Start date}, OR(Now() < {Next date}, {Next date}=“”)),“current”))

This would give the correct output.

But when I tried using instead of NOW() > TODAY()

IF({Count}<=1, “current”, IF(AND({Count}>1, {TODAY()} > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))

It would throw a completely different result, completely shift on dates.

WHY?

3 Replies 3
Andrey_Kovalev
8 - Airtable Astronomer
8 - Airtable Astronomer

@Christian_Heins It seems there is a mistake in the second formula:
IF({Count}<=1, “current”, IF(AND({Count}>1, {TODAY()} > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))
Function TODAY() should not be placed in curly braces as they denote the field name.

Christian_Heins
5 - Automation Enthusiast
5 - Automation Enthusiast

Sorry the formula I used was without the braces on today:

IF({Count}<=1, “current”, IF(AND({Count}>1, TODAY() > {Start date}, OR(TODAY() < {Next date}, {Next date}=“”)),“current”))

The difference is because TODAY() is set at midnight and NOW() shows the current time.
image
I slightly modified your formula to distinct different CURRENTS.

IF({Count}<=1, 'current', IF(AND({Count} > 1, TODAY() > {Start date}, OR(TODAY() < {Next date}, {Next date} = '')),'current 2','current 3'))```