title: SQL convert string(date or text) to date
body: <p>I have a database which has a column called <code>stringNextDue</code> that contains data like dates (UK format) and text (e.g "overdue", "completed")</p>
  
  <p>I am trying to create a view that shows courses that are due within a month from now:</p>
  
  <pre><code>WHERE 
      CONVERT(DATETIME, mt.stringNextDue , 103) &lt; DATEADD(MONTH, 1, GETDATE())
  </code></pre>
  
  <p>This throws an error:</p>
  
  <blockquote>
    <p>Conversion failed when converting date and/or time from character string.</p>
  </blockquote>
  
  <p>Which is probably due to the fact that <code>stringNextDue</code> may contain actual strings of text.</p>
  
  <p>I tried using </p>
  
  <pre><code>WHERE 
      ISDATE(mt.NextDateString) = 1 
      AND CONVERT(DATETIME, mt.stringNextDue , 103) &lt; DATEADD(MONTH, 1, GETDATE())
  </code></pre>
  
  <p>But <code>ISDATE</code> only accepts US date formats therefore ignoring a lot of actual dates as strings</p>
  
  <p>Tried <code>set dateformat 'dmy'</code>, which fixed the <code>IsDate</code> issue, but it cannot be used in views.</p>
  
  <p>Any suggestions?</p>
  
  <p>Server update is not an option</p>