title: SQL server v17 : how to convert smalldatetime value to datetime
body: <p>I used following query to insert the data :</p>
  
  <pre><code> CASE(isdate([Date])) 
              WHEN 1 THEN [date] 
              WHEN 0 THEN cast(substring([Date],0,5) - 2 as smalldatetime)
              ELSE [date] END 
  </code></pre>
  
  <p>Now, datetime column has date in smalldatetime format. How to convert smalldatetime formatted date to datetime format whereas column type is datetime.</p>
  
  <p>Example: For Numeric date <code>41298</code> it resulted into <code>1911-04-21 00:00:00</code> but actual expected result was <code>2013-01-26 00:00:00.000</code></p>