How to get COUNT of a range between 2 columns
This is a way of doing it. However, if you need it broken out by day, you need to add an extra column in your table for indicating the day, and you should add that column to the table variable I created as well.

    DECLARE @Hours TABLE
    (
      hour varchar(2),
      total int
    )
    DECLARE @I INT 
    SET @I = 0
    WHILE @I &lt; 24
    begin
        INSERT INTO @Hours VALUES (RIGHT('0' + CAST(@I AS VARCHAR(2)),2), 0)
        SET @I = @I + 1
    end 


    DECLARE @starthour VARCHAR(2)
    DECLARE @endhour VARCHAR(2)
    DECLARE cur CURSOR
    FOR SELECT starthour, endhour FROM WorkTime
    OPEN cur
    FETCH NEXT FROM cur
    INTO @starthour, @endhour
    WHILE @@FETCH_STATUS = 0
    begin
        UPDATE @hours
        SET total = total + 1
        WHERE hour BETWEEN @starthour AND @endhour
        FETCH NEXT FROM cur INTO @starthour, @endhour
    end
    CLOSE cur
    DEALLOCATE cur

SELECT * FROM @hours
WHERE total &lt;&gt; 0


OUTPUT

hour    total
08      1
09      2
10      2
11      3
12      3
13      3
14      3
15      4
16      4
17      3
18      2
19      2
20      2
21      2
22      1