title: Selecting most recent date between two columns
body: <p>If I have a table that (among other columns) has two DATETIME columns, how would I select the <strong>most recent</strong> date from those two columns.</p>
  
  <p>Example:</p>
  
  <pre><code>ID     Date1     Date2
  
  1      1/1/2008   2/1/2008
  
  2      2/1/2008   1/1/2008
  
  3      1/10/2008  1/10/2008
  </code></pre>
  
  <p>If I wanted my results to look like </p>
  
  <pre><code>ID     MostRecentDate
  
  1      2/1/2008
  
  2      2/1/2008
  
  3      1/10/2008
  </code></pre>
  
  <p>Is there a simple way of doing this that I am obviously overlooking? I know I can do subqueries and case statements or even write a function in sql server to handle it, but I had it in my head that there was a max-compare type function already built in that I am just forgetting about.</p>