title: How to convert string to date in databricks sql
body: <p>I have a column named opened_dt with a timestamp in string format.</p>
  <pre><code>+----------------------------+
  |        opened_dt           |
  +----------------------------+
  | 01/01/2015 21:50:00.000000 |
  +----------------------------+
  </code></pre>
  <p>Running</p>
  <pre><code>DESCRIBE TABLE 'myTable'
  </code></pre>
  <p>tells me that the column is of type string</p>
  <pre><code>+-----------+-----------+---------+
  | col_name  | data_type | comment |
  +-----------+-----------+---------+
  | opened_dt | string    | null    |
  +-----------+-----------+---------+
  </code></pre>
  <p>What I want to do:</p>
  <pre><code>&quot;Show me all entries starting 01.01.2019 until now&quot;.
  Which I translate to &quot;select * from 'table' where opened_dt &gt;= 01.01.2019&quot;.
  </code></pre>
  <p>Following this I convert opened_dt from to date.</p>
  <p>When using:</p>
  <pre><code>SELECT cast(opened_dt AS timestamp) 
  </code></pre>
  <p>just gives me</p>
  <pre><code>+------------+
  | opened_dt  |
  +------------+
  | null       |
  +------------+
  </code></pre>
  <p>When using:</p>
  <pre><code>SELECT to_date(opened_dt AS timestamp) 
  </code></pre>
  <p>just gives me</p>
  <pre><code>+---------------------------------+
  | to_date('myTable'.`opened_dt`)  |
  +---------------------------------+
  | null                            |
  +---------------------------------+
  </code></pre>
  <p>Other attemps I tried but gives false output:</p>
  <pre><code>SELECT * FROM 'myTable' WHERE opened_dt &gt;= '01/01/2019 00:00:00.000000' 
  
  SELECT * FROM 'myTable' WHERE opened_dt IN ('%2019%', '%2020%', '%2021%') 
  </code></pre>
  <p>How can I convert the string to date to filter all dates younger than 01.01.2019?</p>
  <p>I am looking for something in SQL in DATABRICKS (other answers are in spark).</p>