Hi @Avi_Doe - the Airtable formula functions need to be a bit different for this to work. To compare dates you need to use the IS_BEFORE
and IS_AFTER
methods. When you use these you need to parse the date string you are passing in to compare. So this in your formula:
{Date of Perfomance}>06/30/2020
becomes this:
IS_AFTER({Date of Perfomance}, DATETIME_PARSE('06/30/2020', 'MM/DD/YYYY'))
And similarly for the second date using IS_BEFORE.
Hi @Avi_Doe - the Airtable formula functions need to be a bit different for this to work. To compare dates you need to use the IS_BEFORE
and IS_AFTER
methods. When you use these you need to parse the date string you are passing in to compare. So this in your formula:
{Date of Perfomance}>06/30/2020
becomes this:
IS_AFTER({Date of Perfomance}, DATETIME_PARSE('06/30/2020', 'MM/DD/YYYY'))
And similarly for the second date using IS_BEFORE.
Thank you very much! It worked well.
The complete formula I used was:
IF(AND(IS_AFTER({Date of performance}, DATETIME_PARSE(‘06/30/2020’, ‘MM/DD/YYYY’)),IS_BEFORE({Date of performance}, DATETIME_PARSE(‘01/01/2021’, ‘MM/DD/YYYY’))),16,19)
FWIW, you can use > and < to compare dates. However, as @JonathanBowen pointed out, they need to be actual dates (parsed using DATETIME_PARSE()
, or from a date field). This should also work:
IF(AND({Date of performance} > DATETIME_PARSE('06/30/2020', 'MM/DD/YYYY'), {Date of performance} < DATETIME_PARSE('01/01/2021', 'MM/DD/YYYY')),16,19)