Funny, was involved in the discussion of a similar question the other day :)
SELECT transaction_date, MAX(concurrent_count)
FROM ( SELECT transaction_date, Transaction_Time, Transaction_Type
,SUM( CASE WHEN transaction_type = 'OPENTILL' THEN 1 ELSE -1 END )
OVER( PARTITION BY transaction_date
ORDER BY Transaction_Time ) AS concurrent_count
FROM myTable
) x
GROUP BY transaction_date
A sample run in Postgres:
postgres=# SELECT transaction_date, Transaction_Time, Transaction_Type
postgres-# ,SUM( CASE WHEN transaction_type = 'OPENTILL' THEN 1 ELSE -1 END )
postgres-# OVER( PARTITION BY transaction_date ORDER BY Transaction_Time ) AS concurrent_count
postgres-# FROM myTable;
transaction_date | transaction_time | transaction_type | concurrent_count
------------------+------------------+------------------+------------------
2013-02-25 | 08:00:00 | OPENTILL | 1
2013-02-25 | 08:01:00 | OPENTILL | 2
2013-02-25 | 08:02:00 | OPENTILL | 3
2013-02-25 | 09:00:00 | CLOSETILL | 2
2013-02-25 | 09:01:00 | CLOSETILL | 1
2013-02-25 | 10:00:00 | OPENTILL | 2
2013-02-25 | 11:00:00 | OPENTILL | 3
2013-02-25 | 12:00:00 | OPENTILL | 4
2013-02-25 | 13:00:00 | CLOSETILL | 3
2013-02-25 | 14:00:00 | CLOSETILL | 2
2013-02-25 | 15:00:00 | CLOSETILL | 1
2013-02-25 | 20:00:00 | CLOSETILL | 0
(12 rows)
postgres=# SELECT transaction_date, MAX(concurrent_count)
postgres-# FROM ( SELECT transaction_date, Transaction_Time, Transaction_Type
postgres(# ,SUM( CASE WHEN transaction_type = 'OPENTILL' THEN 1 ELSE -1 END )
postgres(# OVER( PARTITION BY transaction_date ORDER BY Transaction_Time ) AS concurrent_count
postgres(# FROM myTable
postgres(# ) x
postgres-# GROUP BY transaction_date;
transaction_date | max
------------------+-----
2013-02-25 | 4
(1 row)