Sill not understand the requirement.
If you enter 16-JAN-2013, which sums do you want? From which date(s) to which date(s)?
And what should then be the results for the data you gave?
The question are clear, I hope a clear answer.
It should be only 2 lines:
- result 1: from date A to date B -> value N
- result 2: from date C to date D -> value M
replace A, B, C, D, N and M by the wanted values. It is simple.