title: Conversion failed when converting varchar value to data type int in SQL
body: <p>I am having some difficulty getting the difference between two time values in SQL. I want to select all the values that have less than 5 seconds difference between the start and stop of the date value. </p>
  
  <p>My data looks like this</p>
  
  <pre><code>Stop
  -----------------------    
  2017-10-04 16:32:06:000
  
  Start
  -----------------------    
  2017-10-04 16:32:02:000
  </code></pre>
  
  <p>The above scenario would be one of those calls. My code in the where clause to obtain only values in the data that are less than 5 seconds:</p>
  
  <pre><code>  datediff(second, cast(stop as int), cast(start as int)) &lt; 5
  </code></pre>
  
  <p>I also tried just datediff without the cast as int and still received the same error:</p>
  
  <blockquote>
    <p>Conversion failed when converting the varchar vlue '2017-10-04 20:58:46:000' to data type int</p>
  </blockquote>