title: Access Last keyword query to SQL conversion
body: <p>I would like to convert an Access query with the last keyword to SQL Server 2005 but cannot figure it out any help is appreciated.</p>
  
  <p>The query in Access is </p>
  
  <pre><code>SELECT field1, field2, Last(field3) , Last(field4) , Last(DateField) 
  FROM table
  GROUP BY field1, field2
  HAVING (((Last(DateField)) Between #9/1/2012# And #9/30/2012#));
  </code></pre>
  
  <p>I have tried to sort Datefield in descending order in SQL and used the MIN keyword on datefield but to no avail, also in SQL I have to group by all the fields and not just 2 fields as in Access.</p>
  
  <p>Thanks in advance.</p>