title: SQL - Count number of rows based on date and when next three columns are same
body: <p>I need to create a report.  In this query I have four columns being selected</p>
  
  <ul>
  <li>Date - yyyy/mm/dd hh:mm:ss format</li>
  <li>ID - A six int number</li>
  <li>GroupNumber - Single character int</li>
  <li>Type - Single character</li>
  </ul>
  
  <p>I need to count how many rows exist where the date is different but the ID, GroupNumber, Type are the same.  The date doesn't necessarily need to be displayed</p>
  
  <p>Here is the code I have so far</p>
  
  <pre><code>    Select DISTINCT CAST(MeasureDate AS Date) AS MeasureDate,
      StudyNumber, GroupNumber, [Type]
      From tUserEquipMeas
  
      Group by StudyNumber, MeasureDate, GroupNumber, [type]
  </code></pre>