Data aggregation based on date
===

I've a table like this (ldate d, amt n(7), rdate d). Fields are loan date, amount, release date.

Here, a record is considered pending which has an empty release date. For example,

    SELECT SUM(AMT) FROM TABLE WHERE RDATE = {}

gives the nett pending amount till date

When calculating pending amount for a given date, a record is considered as pending if it has an empty release date or if it has been released later than the given date! So to calculate pending amount on {2011-10-09}, the query is: 

    SELECT SUM(AMT) FROM TABLE WHERE LDATE <= {2011-10-09} AND (RDATE > {2011-10-09} OR RDATE = {})

Now, how would I calculate pending amount year-wise from the above table? The result I expect is like this:

    Year	PendingAmt 
    2009	1,15,000 
    2010	1,38,000 
    2011	1,71,000

Note: The actual table has many other fields. For brevity, I've mentioned only the important fields here.

Thanks