title: report builder - queries returning incorrect results
body: <p>I have set a reporting project where I would like to get stats for my tables and later integrate this into a webservice. For the following queries though, I am getting incorrect results and I will note where below:</p>
  
  <p>1 - Get the number of new entries for a given day</p>
  
  <pre><code> SELECT COUNT(*) AS RecordsCount,CAST(FLOOR(CAST(dateadded AS float)) 
   AS datetime)as collectionDate 
   FROM TFeed GROUP BY CAST(FLOOR(CAST(dateadded AS float))
   AS datetime) order by collectionDate
  </code></pre>
  
  <p>works fine and I am able to put this in a bar graph successfully.</p>
  
  <p>2 - Get the top 10 searchterms with the highest records per searchterm requested by a given client in the last 10 days</p>
  
  <pre><code>SELECT TOP 10 searchterm, clientId, COUNT(*) AS TermResults FROM TFeed 
  where dateadded &gt; getdate() - 10 GROUP BY 
  searchterm,clientId order by TermResults desc
  </code></pre>
  
  <p>does not work
  If I do a query in the Database for one of those terms that returns 98 in the report, the result is 984 in the database.</p>
  
  <p>3 - I need to get the number of new records per client for a given day as well.</p>
  
  <p>Also I was wondering if it is possible to put these queries into one report and not individual reports for each query which is not a big deal but having to cut and paste into one doc afterwards is tedious.</p>
  
  <p>Any ideas appreciated</p>