I have a field that contains date values, currently a string field, that has multiple formats that i need to convert to an actual date field. The current values are "yyyy-mm-dd" and "mm/dd/yyy". I have tried the DateTime parse tool but with multiple formats this isnt successful. Anyone run across this?
Solved! Go to Solution.
Here is the blog post that goes along with the macro. The last paragraph might help point you in the right direction.
Hi Mark,
your formula works great, I tried to add another condition for my use case. my date could come in as:
20200610 therefore would like it output as 2020-06-10
my current result looks like 2020--30
Thank you
IF Contains([date],"-") THEN date ELSEIF Contains([date],"/") THEN Regex_Replace([date],"(\d{1,2})(/)(\d{1,2})(/)(\d{4})","$5-$1-$3")
ElSEIF
Contains([date],"") THEN Regex_Replace([date],"(\d{4})(\d{1,2})(\d{1,2})","$1-$5-$3") ELSE Null() ENDIF