To find that particular day top performer and overall performer

Database
Enthusiast

To find that particular day top performer and overall performer

Top performer for that particular day is calculated by (Goodcheckin-Badcheckin) for that particular day

Overall top performer  is calculated by (Goodcheckin-Badcheckin) for 1st day,

similarly we have calculate Overall top performer for 2nd day =addition of 1st day +2nd day,

Similarly we have calculate for 3rd day & 4th day

 

Input Details:

EMPIDNAMEGOODCHECKINBADCHECKINCHECKIN DATE
1TOM3214/02/2017
1TOM4115/02/2017
1TOM2816/02/2017
1TOM3117/02/2017
2JERRY4114/02/2017
2JERRY0015/02/2017
2JERRY1316/02/2017
2JERRY0417/02/2017
3SARAVANAN6014/02/2017
3SARAVANAN2115/02/2017
3SARAVANAN101116/02/2017
3SARAVANAN5117/02/2017

 

Output :

Output should be 

 

EMPIDNAMECHECKIN DATETop performer on that dayOverall Top perfomer
3SARAVANAN14/02/201766
1TOM15/02/201737
3SARAVANAN16/02/2017-16
3SARAVANAN17/02/2017410