title: Need to calculate by rounded time or date figure in sql server
body: <p>i have 2 data columns in Ms Sql 2008</p>
  
  <p>uniqueidentifier column as ID and a datetime column with a few results like follows.</p>
  
  <pre><code>2011-11-06 18:02:18.030
  2011-11-06 18:02:18.373
  2011-11-06 18:02:57.560
  2011-11-06 18:02:58.593
  2011-11-06 18:03:01.717
  2011-11-06 18:03:02.373
  2011-11-06 18:03:03.407
  </code></pre>
  
  <p>Aside from the complexity of the ID column.
  I'm only interested in grouping the data based om intervals per </p>
  
  <pre><code>minutes(1,5,10,15,30)
  hours (1,2)
  days(1,5,10)
  months(1,2)
  </code></pre>
  
  <p>The results should be floored or otherwise to yield only 1 unique per interval
  As follows</p>
  
  <pre><code>2011-11-06 18:02:00 (1 Minute)
  2011-11-06 18:03:00 (1 Minute)
  2011-11-06 18:04:00 (1 Minute)
  2011-11-06 18:05:00 (1 Minute)
  2011-11-06 18:06:00 (1 Minute)
  </code></pre>
  
  <p>Or per day </p>
  
  <pre><code>2011-11-06 00:00:00 (1 Day)
  2011-11-07 00:00:00 (1 Day)
  2011-11-08 00:00:00 (1 Day)
  2011-11-09 00:00:00 (1 Day)
  2011-11-10 00:00:00 (1 Day)
  </code></pre>
  
  <p>etc.</p>
  
  <p>Any constructive suggestions would be welcome.</p>