title: Select min(date), max(date) and group by day from one column - SQL
body: <p>I'm going nuts soon please help.</p>
  
  <p>I have one column containing <code>datetime</code> values.</p>
  
  <p>I need to find min and max for every day.</p>
  
  <p>The data looks like this</p>
  
  <pre><code>2012-11-23 05:49:26.000  
  2012-11-23 07:55:43.000  
  2012-11-23 13:59:56.000  
  2012-11-26 07:51:13.000  
  2012-11-26 10:23:31.000  
  2012-11-26 10:25:09.000  
  2012-11-26 16:22:22.000  
  2012-11-27 07:30:03.000  
  2012-11-27 08:53:47.000  
  2012-11-27 10:40:55.000  
  </code></pre>
  
  <p>This is what tried so far  </p>
  
  <pre><code>select distinct(convert(nvarchar, datum, 112)), min(datum), max(datum) 
  from myTable
  </code></pre>
  
  <p>but when I </p>
  
  <pre><code>Group by
  </code></pre>
  
  <p>I group on all 3 columns...</p>
  
  <p>I seems not to work to set my first select as ColName and Group on this</p>
  
  <p>This is what I want</p>
  
  <pre><code>20121123 | 2012-11-23 05:49:26.000 | 2012-11-23 13:59:56.000  
  20121126 | 2012-11-26 07:51:13.000 | 2012-11-26 16:22:22.000  
  20121127 | 2012-11-27 07:30:03.000 | 2012-11-27 10:40:55.000  
  </code></pre>