title: Statistics Query Water Quality MS ACCESS
body: <p>I have a water quality database that I want to run some queries on. The table for this query has the following 4 columns:</p>
  
  <p>Site_ID, SampleDate, Parameter, and Results</p>
  
  <p>The data looks something like this (example)</p>
  
  <p>LB-100, 1/14/2014,"Calcium, Dissolved","2.2"</p>
  
  <p>LB-100, 8/30/2015,"Calcium, Dissolved","2.2"</p>
  
  <p>LB-100, 2/14/2014,"Calcium, Dissolved","2.1" </p>
  
  <p>LB-500, 1/14/2014,"Calcium, Dissolved","8.0"</p>
  
  <p>LB-100, 3/14/2014,"Calcium, Dissolved","2.4" </p>
  
  <p>LB-100, 4/14/2014,"Calcium, Dissolved","2.4" </p>
  
  <p>LB-100, 5/14/2014,"Calcium, Dissolved","2.1" </p>
  
  <p>I want to have a query that provides min, max, avg, SD, and count for all of 2014 at each selected Sample Site in order to create some annual reports. For the 7 example rows above, I would like to end up with one query output row that looks like this:</p>
  
  <p>LB-100,"Calcium, Dissolved", 2.1, 2.4, 2.24, 0.14, 5 (these values correspond to min, max, avg, SD, and count for all 2014 data at LB-100).</p>
  
  <p>So far, I have done the following in query design view. 
  <a href="http://i.stack.imgur.com/i8mgq.jpg" rel="nofollow">screenshot</a></p>
  
  <p>The problem, the query returns the correct records but doesn't calculate the desired statistics. Instead, it simply returns 5 rows that look like this:</p>
  
  <p>LB-100, 1/14/2014,"Calcium, Dissolved","2.2", "2.2", "2.2", , 1</p>
  
  <p>LB-100, 2/14/2014,"Calcium, Dissolved","2.1", "2.1", "2.1", , 1 </p>
  
  <p>LB-100, 3/14/2014,"Calcium, Dissolved","2.4", "2.4", "2.4", , 1  </p>
  
  <p>LB-100, 4/14/2014,"Calcium, Dissolved","2.4", "2.4", "2.4", , 1  </p>
  
  <p>LB-100, 5/14/2014,"Calcium, Dissolved","2.1", "2.1", "2.1", , 1  </p>
  
  <p>Of course I could simply add a totals row in the results view to obtain the desired information, but this is not feasible since I have hundreds of stations and 50 or more parameters.</p>
  
  <p>There has got to be an easy way to do this in a query?!</p>
  
  <p>Thanks for your help!</p>