EESDL
I think this has a fairly straight forward solution. But, I am not clear on how you want to present the results.
As I read your outline:
Each row has one job with a 'job code'. That job has a total number of hours split between five 'cost codes'.
Each date can contain a number of job rows, which is indicated by the date column in the job row.
The row entries are in random order.
What I need to know is how you what to show the output?
Do you want a table? ie:
Columns with cost codes.
Rows with job codes.
summarised data in the table.
Or do you need something else?
EG