re : Developer Challenge
This is an answer (attempt) for Dror Engel's dev challenge (here - hebrew). I will translate his challenge according to popular demand :)
Well, Dror, assuming that in your DB table you only keep the sum of each transaction and it's date, and each account starts off from a balance of 0, then the following SQL query can give you the "starting value" to work with in each page (the balance at row "one after the last" relevant to the current page), given the current page number and the page size being used :
SELECT SUM(ActionSum)
FROM
(SELECT
row_number() OVER (ORDER BY actionDate DESC) as RowId,
ActionSum
FROM actions) as history
WHERE RowId > (@pagesize * @pagenum)
This syntax works on mssql 2005 and above, but I believe there is similar syntax for oracle. You could do something similar in sql 2000 but that would require a temp table, whether it's a table variable or a real one.
I hope this helps in any way, and that I didn't misunderstand :)
I don't really like doing this kind of stuff per page (i.e. if your table gets REALLY big, this might get heavy... ), so I _would_ keep something extra in the database, even if it's the current balance, or an ugly calculated field for that matter.. but that's just me :P
** comment : this could be optimized a bit for larger tables, using TOP + reversing the order by + precalculating the total amount of pages, but since you are talking about approx. 300 records, this should do.