scottyjohn
Technical User
Hi all,
I have a view which has the following columns,
STARTTIME
ENDTIME
The data is in the format hh:mm:ss but I think it is actually in text format rather than time as such. The underlying table has this column in UTC, and a conversion is done in the structure of the view to give us the time as above. Each record is an event with a starttime and endtime. What I have been asked to produce is a way to tell for a given minute, how many concurrent event are in progress? I cant think how to achieve this. If it was the other way round and it was to see how many records' starttimes fell between two times, then I could use between, but as the entry must look at the starttime and endtime of each record and work out if in its duration it matched the criteria time, I cant figure out if this is possible? Pseudo code would look something like this I think....
select count(*)
from tableA
where times between starttime and Endtime
= '22:54:00'
I hope this makes sense and thanks in advance for any help
John
I have a view which has the following columns,
STARTTIME
ENDTIME
The data is in the format hh:mm:ss but I think it is actually in text format rather than time as such. The underlying table has this column in UTC, and a conversion is done in the structure of the view to give us the time as above. Each record is an event with a starttime and endtime. What I have been asked to produce is a way to tell for a given minute, how many concurrent event are in progress? I cant think how to achieve this. If it was the other way round and it was to see how many records' starttimes fell between two times, then I could use between, but as the entry must look at the starttime and endtime of each record and work out if in its duration it matched the criteria time, I cant figure out if this is possible? Pseudo code would look something like this I think....
select count(*)
from tableA
where times between starttime and Endtime
= '22:54:00'
I hope this makes sense and thanks in advance for any help
John