title: SQL Server ORDER BY date and nulls last
body: <p>I am trying to order by date. I want the most recent dates coming in first. That's easy enough, but there are many records that are null and those come before any records that have a date.</p>
  
  <p>I have tried a few things with no success:</p>
  
  <pre><code>ORDER BY ISNULL(Next_Contact_Date, 0)
  
  ORDER BY ISNULL(Next_Contact_Date, 999999999)
  
  ORDER BY coalesce(Next_Contact_Date, 99/99/9999)
  </code></pre>
  
  <p>How can I order by date and have the nulls come in last? The data type is <code>smalldatetime</code>.</p>