How do you determine whether someone is late? Calc'ing the # of days is simple ... Once you specify what late is then you can use DateDiff to give you the difference and from there determine what "lateness" bucket the tardiness goes in.
we have different deduction rates for different late timings so if a person is say in the month of december late as follows
10to15 16to20 21to25 26to30 above30 above60
name1 2 3 1 0 0 1
name2 4 0 0 0 0 0
so the deduction is a day's salary for 3 days above60. If 10to15 minutes late and if no other late days in other columns maybe just warn and ignore.