Skip to main content
Solved

IF formula help with two DateTime Format outputs

  • August 14, 2021
  • 2 replies
  • 21 views

Hi all,

Is there a way to run Run the first Datetime formula and if an error automatically run the second date time formula to pull the information in?

  1. DATETIME_FORMAT({Date Paid}, ‘MMMM-YYYY’)
  2. DATETIME_FORMAT({Order Date}, ‘MMMM-YYYY’))

Best answer by Martin_Kopischk

If all you need to decide between both is to check if the {Date Paid} data is present, this

DATETIME_FORMAT(IF({Date Paid}, {Date Paid}, {Order Date}), 'MMMM-YYYY')

will do the trick. More generally speaking, if you also want to filter out invalid inputs (not really a scenario handling a date type field, but not all fields are created equal), you can check the result of your first transformation by wrapping it in ISERROR(), then repeating it in the else branch.

2 replies

Forum|alt.badge.img+4

If all you need to decide between both is to check if the {Date Paid} data is present, this

DATETIME_FORMAT(IF({Date Paid}, {Date Paid}, {Order Date}), 'MMMM-YYYY')

will do the trick. More generally speaking, if you also want to filter out invalid inputs (not really a scenario handling a date type field, but not all fields are created equal), you can check the result of your first transformation by wrapping it in ISERROR(), then repeating it in the else branch.


  • Author
  • New Participant
  • August 14, 2021

If all you need to decide between both is to check if the {Date Paid} data is present, this

DATETIME_FORMAT(IF({Date Paid}, {Date Paid}, {Order Date}), 'MMMM-YYYY')

will do the trick. More generally speaking, if you also want to filter out invalid inputs (not really a scenario handling a date type field, but not all fields are created equal), you can check the result of your first transformation by wrapping it in ISERROR(), then repeating it in the else branch.


Superstar !! thank you !!