title: Conversion Failed when Converting DateTime
body: <p>This is my first post so any mistakes apologies in advance.</p>
  
  <p>I am trying to convert a character string into a date format. My string is in the format '20110709_000000'.</p>
  
  <p>I have tried the following queries after research but both return me the following error:
  'Conversion failed when converting datetime from character string.'</p>
  
  <p>I have tried </p>
  
  <pre><code>Select CAST(REPLACE('20110709_000000','_', '') AS DATETIME)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>SELECT CONVERT(DATETIME,REPLACE('20110709_000000','_', ''),109).
  </code></pre>
  
  <p>Any help would be appreciated.</p>