Javascript Logic issue

Consider a table having values:

Date(Column) Hours(Column)
01-07-2010 9
02-07-2010 5
02-07-2010 4
03-07-2010 9

Now I need the dates having less than 9 hours. Here in this table 02-07-2010 also has 9 hours since there are 2 entries for that date. This javascript code should be able to check the sum of hours for that particular date and then get the date for which hours is less than 9 hours. Please help me with the logic. It is urgent.

You could use the same code as in your other thread with minor modifications.