mardi 6 septembre 2016

find consecutive info and reward points accordingly

In the table,I have the columns

: WeekNumber,WeeklyHoursLogged,points_Rewarded

I want to write a query to find out if any employee (see EmployeeName column) has less than 40 (<40) in WeeklyHoursLogged column for week32 and week33 (both i.e consecutively for both week32 and week33).

If the condition is true i.e the employee has less than 40 (<40) in WeeklyHoursLogged column for week32 and week33 (both) then subtract 25 points from the Points_Rewarded column.

Please help me with the query. Refer the below link for table schema.

Thanks in advance.

Table for the above question

Aucun commentaire:

Enregistrer un commentaire