title: How to convert int to datetime with hours and minutes with SQL Server
body: <p>I'm using two databases and I've got a problem. </p>
  
  <p>One uses date with <code>datetime</code> datatype, while the other one uses <code>int</code> (201901010000 for example).</p>
  
  <p>I want to compare them and it needs to be fast, I've tried so far :</p>
  
  <ul>
  <li><code>convert(date, 21)</code> or other numbers (my <code>datetime</code> is <code>YYYY-MM-DD HH:MM:SSSS</code>) but it doesn't work with minutes and hours.</li>
  <li>I tried to delete all the '-' and ':' from the datetime and then convert to int</li>
  </ul>
  
  <p>So my question is simple, how to compare it efficiently?</p>
  
  <p>Thank you =)</p>