I have a bunch of time punch records and need to figure out if a person worked 7 consecutive days where the week starts on Monday and ends on Sunday.
data looks like this...
name, date_worked, start_time1,end_time1, start_time2, end_time2, day_worked , total_hours_worked
day_worked and dateworked are filled in whether the person worked or not, so i have all records flagged as 1 if they have a start_time1 not null or total_hours_worked>0 (has_punch_for_day). a person can have total_hours_worked>0 and not have start/end times.
day_worked= "Monday", "Tuesday",...etc. dateworked is datetime.
I have tried using the row_number() over (partition by day_worked order by has_punch_for_day) but that just gives the count of the day for each punch on that day.
I just can seem to think a good way of doing this.
Any help would be greatly appreciated!! :)