Skip to main content
Solved

Parse a date if exists, otherwise blank

  • February 23, 2023
  • 2 replies
  • 27 views

Forum|alt.badge.img+4

Hello! I'm sure there is a very easy solution for this but I am having trouble figuring it out! 

I have an "Ad Record" field that may or may not have a date at the start (ex. "1/2/23 | Company | Product"). This formula parses out the date for me easily enough:

 

DATETIME_PARSE({Ad Record},'MM/DD/YYYY')

 

However, sometimes there may not be a date (ex. "Company+") so the above formula parses an ERROR. What sort of IF statement would work here to instead leave the field empty?

This didn't work for me:

 

IF({Ad Record}, DATETIME_PARSE({Ad Record},'MM/DD/YYYY'), "")

 

 

 

Thank you! 

Best answer by TheTimeSavingCo

Could you try the following?

IF( ISERROR(DATETIME_PARSE({Ad Record},'MM/DD/YYYY')) != 1, DATETIME_PARSE({Ad Record},'MM/DD/YYYY') )

2 replies

TheTimeSavingCo
Forum|alt.badge.img+31
  • Brainy
  • 6416 replies
  • Answer
  • February 24, 2023

Could you try the following?

IF( ISERROR(DATETIME_PARSE({Ad Record},'MM/DD/YYYY')) != 1, DATETIME_PARSE({Ad Record},'MM/DD/YYYY') )


Forum|alt.badge.img+4
  • Author
  • Participating Frequently
  • 6 replies
  • February 24, 2023

That worked! I knew it would be something simple.

Thank you so much!