title: ddmmyyyy to sql datetime in SQL
body: <p>I need to convert a <code>nvarchar</code> value to <code>datetime</code> in T-SQL. The value is in <code>ddmmyyyy</code> format, e.g. <code>23072009</code></p>
  <p>I need to convert to <code>datetime</code> in T-SQL.</p>
  <p>I tried</p>
  <pre><code>select convert(datetime, '23072009', 103)
  </code></pre>
  <p>But it is throwing error.</p>
  <blockquote>
  <p>&quot;The conversion of a nvarchar data type to a datetime data type
  resulted in an out-of-range value.&quot;</p>
  </blockquote>
  <p>Any idea</p>
  <p>Thanks</p>