title: get only last row in each day's multiple entries in TSQL
body: <p>I have a table, something like: </p>
  
  <pre><code>Id        Name        EnteredOn                    Percentage
  `````````````````````````````````````````````````````````````
  01        person1     2011-03-09 17:29:35.683      56.29
  02        person1     2011-03-09 17:29:35.731      76.29
  03        person1     2011-03-09 18:15:78.683      56.29
  04        person1     2011-03-10 17:29:35.683      56.29
  05        person1     2011-03-10 16:29:31.683      56.29
  06        person1     2011-03-11 17:29:35.683      56.29
  </code></pre>
  
  <p>To summarize the above table, there are <strong>three</strong> rows for day <strong>09</strong>, and <strong>two</strong> rows for day <strong>10</strong>.</p>
  
  <p>Now, I just want to select the latest row - <strong>one single row</strong> - per day.<br>
   <em>(one row for 9, one for 10 and the one for 11)</em> </p>
  
  <p>I cannot use distinct because of the timestamp. I cant group and use:  </p>
  
  <pre><code>CAST(CONVERT(FLOAT, EnteredOn) AS INT)
  </code></pre>
  
  <p>because when I select EnteredOn field, it complaints that its not grouped. I cant combine <code>distinct(cast..date...)</code> because I cant get the right syntax.</p>
  
  <p>How can I select - only <strong>Name, EnteredOn, Percentage</strong> fields with distinct to each day? </p>
  
  <p>many thanks in advance.</p>