title: How to deal with a column that has just date (%m-%d-%Y) and datetime ('%m-%d-%Y %H:%i') records in the same column in AWS Athena?
body: <p>I'm trying to convert a date column of string type to date type.</p>
  <p>I use the below query in AWS Athena:</p>
  <pre><code>SELECT col0, col1, col2, date_parse(replace(col3, '/', '-'), '%m-%d-%Y') AS start_date
  FROM &quot;bucket&quot;.&quot;table&quot;
  WHERE col3 &lt;&gt; ''
  </code></pre>
  <p>This works for some records because some dates are formatted like this: <code>12/08/2019</code>
  But it fails for other dates which are formatted like this: <code>7/1/2019 0:06</code>
  Some other dates are formatted like: <code>2020/04/10 08:39</code></p>
  <p>These different format dates exist in the same column. Dealing with dirty data here... I understand why my query fails because I only have <code>'%m-%d-%Y'</code> format in there. Just wondering how would I deal with something like this so that it can deal with all 3 formats in one query.</p>