I am trying to figure out the best way to write a sql query in order to find out how many consecutive days an employee has worked during a designated timeframe .... The sql table, "TIme" that I am working with is made up of rows which contain a PayRoll Ending Date Field, "prenddate" as well as fields for each day of the week, "Mon", "Tues", "Weds", etc ... The day fields contains the number of hours worked on that day. If the employee has not worked that day then the field contain a zero. Each employee has a new row of data for each week of the year. Weekends and holidays are worked and will therefore need to be considered as part of the consecutive days. Consecutive days can cross weeks in the given timeframe. Assistance with this would be very much appreciated.