Skip to main content
Solved

date comparison bug? or just am I making any mistake?

  • August 25, 2023
  • 3 replies
  • 52 views

Forum|alt.badge.img+5

Something sooooo wierd is happening to me that is driving me crazy

I am trying to compare a date with today. Easy task aparently. (anyway working on dates is never easy to me)

Look what is going on:

Two date fields created

Date 1 is TODAY

Date 2, the date of a free class at my school

Now i created two testing formulas

And testing 2. Just substituting Date 1 field by today()

 

So both formulas are supposed to give the same output, but....

OMG!!! no idea about what is happening! Any help please!

 

Best answer by Andy_Lin1

Oh! so clever attemp, thaaaanks, but it is not working neither. CG is a date so this formula returns an ERROR

 

 


Airtable has a set of functions to handle dates (since it doesn't treat them as Excel would, as date-based numbers). In this case, you can use IS_BEFORE({Date of free class}, TODAY()).

https://support.airtable.com/docs/formula-field-reference#date-and-time-functions

3 replies

Forum|alt.badge.img+21
  • Inspiring
  • 560 replies
  • August 25, 2023

"Date 2" seems to be recognized as a string.

 

DATETIME_PARSE({CG},"M/D/YYYY h:mma")

 

to parse it correctly would fix the problem.


Forum|alt.badge.img+5
  • Author
  • Participating Frequently
  • 9 replies
  • August 25, 2023

Oh! so clever attemp, thaaaanks, but it is not working neither. CG is a date so this formula returns an ERROR

 

 


Forum|alt.badge.img+17
  • Inspiring
  • 183 replies
  • Answer
  • August 25, 2023

Oh! so clever attemp, thaaaanks, but it is not working neither. CG is a date so this formula returns an ERROR

 

 


Airtable has a set of functions to handle dates (since it doesn't treat them as Excel would, as date-based numbers). In this case, you can use IS_BEFORE({Date of free class}, TODAY()).

https://support.airtable.com/docs/formula-field-reference#date-and-time-functions