I am trying to convert a string field to a specific date format. After reviewing previous posts and trying several examples provided, I am still seeing nulls returned.
The string field I need to convert has a couple of different formats of the data, so I am using a Text to Columns tool to isolate the string of data I need. When adding the formula tool to create a new date field it is returning null.
ToDate(datetimeformat([DOS1],'%Y-%m-%d'))
I have also tried using the DateTime tool to convert string to date with yyyy-MM-dd format but that is also returning null.
See attached workflow to view the current data coming in and the expected output.
Example Input:
20221201
20221202-20221203
Expected Output:
2022-12-01
2022-12-02