title: Selecting one record for a day
body: <p>the below query give me address against order date for three sites.
  if more than one orders are completed for a site i want to select only latest record for the site </p>
  
  <pre><code>SELECT DISTINCT ORDERS.Address, ORDERS.ORDERDATE  
  FROM ORDERS
  Left JOIN PHONEDATA AS P
     ON ORDERS.RECID = P.OrderID
  where client IN ('site1','site2','site3')
  </code></pre>
  
  <p>result </p>
  
  <pre><code>Address orderdate
  ------- -----------------------
  Site1   2014-02-13 14:58:22.427
  site1   2014-02-13 14:48:57.413
  site1   2014-02-13 15:03:32.403
  Site2   2014-02-13 13:48:22.427
  site2   2014-02-13 13:30:57.413
  site2   2014-02-13 13:03:32.403
  Site3   2014-02-13 14:12:22.427
  site3   2014-02-13 11:10:57.413
  site3   2014-02-13 13:03:32.403
  Site1   2014-02-14 14:58:22.427
  site1   2014-02-14 14:48:57.413
  site1   2014-02-14 15:03:32.403
  Site2   2014-02-14 13:48:22.427
  site2   2014-02-14 13:30:57.413
  site2   2014-02-14 13:03:32.403
  Site3   2014-02-14 14:12:22.427
  site3   2014-02-14 11:10:57.413
  site3   2014-02-14 13:03:32.403
  </code></pre>
  
  <p>Expected result</p>
  
  <pre><code>site1   2014-02-13 15:03:32.403
  Site2   2014-02-13 13:48:22.427
  Site3   2014-02-13 14:12:22.427
  site1   2014-02-14 15:03:32.403
  Site2   2014-02-14 13:48:22.427
  Site3   2014-02-14 14:12:22.427
  </code></pre>
  
  <p>so picking the latest record</p>
  
  <p>UPDATE: sorry guys i should have mentioned, i want the latest value for that day.
  i have updated the expected result, so rather than selecting the overall latest value for site1, i want to display the latest value for site 1 for a given day, repeated each day if there is a value for that site </p>