title: Converting an InT field to date time
body: <p>Im using MSSQL 2008 and have a field called AbsoluteDates that contains data in numeric for mat, for example</p>
  
  <pre><code>AbsoluteDates
  20051216
  20051217
  20051218
  10000
  90
  600
  </code></pre>
  
  <p>What i need to do is a "Select" statement that will ignore any date thats not 8 numbers in lenth and then convert the results to a datetime ,aso it should be like a case statement becuase i need to produce something when the length is not 8 charectors , for example the word " NotValid"</p>
  
  <p>so for example , Select AbosluteDates from Calendar where lenth = 9 would give me the following results if i had the same data as above. </p>
  
  <pre><code>AbsoluteDates
  2005-12-16 00:00:00.000
  2005-12-17 00:00:00.000
  2005-12-18 00:00:00.000
  NotValid
  NotValid
  NotValid
  </code></pre>