title: Redshift can't convert a string to a date, tried multiple functions
body: <p>I have a table with a field called <code>ADATE</code>, it is a <code>VARCHAR(16)</code> and the values are like so: <code>2019-10-22-09:00</code>.</p>
  
  <p>I am trying to convert this do a <code>DATE</code> type but cannot get this to work.</p>
  
  <p>I have tried:</p>
  
  <p><strong>1</strong></p>
  
  <pre><code>TO_DATE(ADATE, 'YYYY-MM-DD')
  </code></pre>
  
  <blockquote>
    <p>Can't cast database type date to string</p>
  </blockquote>
  
  <p><strong>2</strong></p>
  
  <pre><code>TO_DATE(LEFT(ADATE, 10), 'YYYY-MM-DD')
  </code></pre>
  
  <blockquote>
    <p>Can't cast database type date to string</p>
  </blockquote>
  
  <p><strong>3</strong></p>
  
  <pre><code>TO_DATE(TRUNC(ADATE), 'YYYY-MM-DD')
  </code></pre>
  
  <blockquote>
    <p>XX000: Invalid digit, Value '-', Pos 4, Type: Decimal</p>
  </blockquote>
  
  <p><strong>4</strong></p>
  
  <pre><code>CAST(ADATE AS DATE)
  </code></pre>
  
  <blockquote>
    <p>Error converting text to date</p>
  </blockquote>
  
  <p><strong>5</strong></p>
  
  <pre><code>CAST(LEFT(ADATE, 10) AS DATE)
  </code></pre>
  
  <blockquote>
    <p>Error converting text to date</p>
  </blockquote>
  
  <p><strong>6</strong></p>
  
  <pre><code>CAST(TRUNC(ADATE) AS DATE)
  </code></pre>
  
  <blockquote>
    <p>Error converting numeric to date</p>
  </blockquote>