I believe that the solution to your problem can be achieved with aj
Initially, as you indicated, the table should be sorted by time
`time xasc `tab;
Then you need to create a cumulative sum of volumes using the amounts
tab:update cumvol:sums vol by name from tab
Then, using aj, get the cumulative sums of volumes that are not included in 2-hour periods for each time.
aj[`name`time;tab;select time:time+02:00,name,cumvol2:cumvol from tab]
Then we can do cumvol-cumvol2 to get the total volume for each 2-hour period
tab:select time, name, runningvol:cumvol-0^cumvol2 from aj[`name`time;tab;select time:time+02:00,name,cumvol2:cumvol from tab]
Then a simple select statement can get the time when cumvol is greater than 100
select time,time+02:00 from tab where runningvol>100
An improvement that could be added to this would be to add a grouped attribute to the second table in aj. Another improvement to this would be to format dates and times into a single timestamp or date and time.
More information about the aj and sum functions can be found here:
http://code.kx.com/q/ref/joins/#aj-aj0-asof-join
http://code.kx.com/q/ref/arith-integer/#sums