Skip to main content
Solved

What is wrong with this IF Statement?

  • February 11, 2020
  • 3 replies
  • 17 views

Forum|alt.badge.img+17

What is wrong with this IF Statement?

Best answer by Jeremy_Oglesby

It’s missing an opening parenthesis, and it’s got an an unparsed date string.
You need to use DATETIME_PARSE() to parse the string into a DateTime object to compare with your Date field.

Also, you may want to use the IS_AFTER() date comparison function.

I think this should be your equivalent formula:

IF(
   IS_AFTER(
      {purchase-date},
      DATETIME_PARSE("02/01/2020", 'MM/DD/YYYY')
   ),
   "Yes",
   "No"
)

3 replies

Forum|alt.badge.img+18
  • Inspiring
  • Answer
  • February 11, 2020

It’s missing an opening parenthesis, and it’s got an an unparsed date string.
You need to use DATETIME_PARSE() to parse the string into a DateTime object to compare with your Date field.

Also, you may want to use the IS_AFTER() date comparison function.

I think this should be your equivalent formula:

IF(
   IS_AFTER(
      {purchase-date},
      DATETIME_PARSE("02/01/2020", 'MM/DD/YYYY')
   ),
   "Yes",
   "No"
)

Forum|alt.badge.img+17
  • Author
  • Known Participant
  • February 11, 2020

Thanks you very much


Forum|alt.badge.img+18

Thanks you very much


You’re welcome :slightly_smiling_face: