• option 1 :

    create a CURSOR.For each row in the table, read the columns into varibales and check for the range and then update a counter,later update the counter before jumping on to the next row.

    option2:

    use CASE statement to update the counter Column which whill be something like:

    update

    set =

    case when [time1 & time2&time3 in range] then 3

    when [time1 & time2 in range] OR [time 1 & time3 in range] OR [time2 &3 in range] then 2,... like wise ..