DBMS : MS SQL 2005
Consider the following table as an example
[CurrencyID] ---- [Rate] ---- [ExchangeDate]
USD --------------- 1 ------ 08/27/2012 11:52 AM
USD -------------- 1.1 ----- 08/27/2012 11:58 AM
USD -------------- 1.2 ----- 08/28/2012 01:30 PM
USD --------------- 1 ------ 08/28/2012 01:35 PM
How can i get the rate of the latest [ExchangeDate] Per Day for each currency ?
The output would be :
[CurrencyID] ---- [Rate] ---- [ExchangeDate]
USD ----------- 1.1 ------- 08/27/2012
USD ------------ 1 -------- 08/28/2012