title: Column is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
body: <p>Clearly, when GROUP BY clause used, columns that are not aggregate function should be part of the group by clause. The problem here is, I cannot contain HTTPADDRESS &amp; DATEENTERED columns in GROUP BY clause. Also, I dont know a function that will give me the latest entries of all. </p>
  
  <p>edit: I use sql-server. I would use LAST function if I were using access.</p>
  
  <pre><code>SQL = "SELECT VISITORIP, HTTPADDRESS, DATEENTERED"
  SQL = SQL &amp; " FROM STATS"
  SQL = SQL &amp; " WHERE DATEENTERED BETWEEN '" &amp; OnlineTime &amp; "' AND '" &amp; NOW() &amp; "'"
  SQL = SQL &amp; " GROUP BY VISITORIP"
  SQL = SQL &amp; " ORDER BY DATEENTERED DESC"
  Set objOnVisitors = objConn.Execute(SQL)    
  </code></pre>