title: Group by date in SQL Server
body: <p>I'm having a problem with grouping in SQL Server.</p>
  
  <p>I have a <code>datetime</code> column but I want to group only by date,</p>
  
  <p>Here's my code</p>
  
  <pre><code>SELECT ProductCode,
         ProductName,
         ProductType,
         UnitPrice,QTY,
         Amount,
         (convert(varchar, TransactionDate, 101) )AS sTransactionDate
  FROM DailyTransactions 
  GROUP BY TransactionDate, ProductCode,
            ProductName,ProductType,UnitPrice,QTY,Amount
  </code></pre>
  
  <p>RESULT:</p>
  
  <p><code>2/17/2012</code> appears three times because it has different times ...</p>