title: SQL Query, return Price for Max(DateField)
body: <p>I have this sql table:</p>
  
  <pre><code>Niin char(9)
  EffectiveDate Date
  Price  currency
  </code></pre>
  
  <p>The NIIN repeates itself with different EffectiveDate and Price values like so</p>
  
  <pre><code>**NIIN           EffectiveDate       Price**
  
  012345678        6/1/2011              89.00
  012345678        6/1/2012              99.00
  012345678        6/1/2012              99.00
  123456789        5/1/2011              77.00
  123456789        5/1/2012              80.00
  123456789        5/1/2012              80.00
  etc....
  </code></pre>
  
  <p>What I need to do is return the NIIN, with the Price of the Max EffectiveDate, assuming that if there are duplicate EffectiveDate values, the Price will always be the same. </p>
  
  <p>Therfore from the example I supplied the query would return:</p>
  
  <pre><code>012345678       99.00
  123456789       80.00
  </code></pre>
  
  <p>Thanks for any help.</p>