• Hi Lynn Pettis,

    On my laptop the old source code took 546ms whereas your new source code took 124ms only. Very good improvement.

    Can you also explain to me if it's the index on DYT table what made the difference because I tried to use CASE WHEN then else END statements which did not give me good result. I had then resorted to having sub queries for each day with SELECT command because otherwise I was getting one record for each day per employee but the values placed in the right column which I would sum up again with a new view to get the desired result of one line per employee for a month.

    Thanks for your great help.