Retrieving Datatable Row index
Hello All,
I need to make a query in a datatable in a time range and once I have the results I need to get the row index so I get the immediate previous entry, and sometimes the immediate next one too. I will try to represent it in the image below:

For example:
I want to query the events between 12:00 and 16:00. If I make a query to get me the results with startTime>12 and and Time<16 it will return Events #3 and #4, when in fact I need to get partially the times in Events #2 and #5.
I considered querying the whole table into and infotable and then iterating it but it could be too much data. I also considered querying X hours before the startTime and Y hours after the end time, but this can be very flexible, so adding a couple of extra hours in the range might not solve.
The way I thought it could work is if I queried the range, then got the KEY of the first and last items in the result and queried them again in the original DataTable, now trying to return its row index, but I am not sure if it is possible. I did not find any OOTB service to do it.
Do you guys have any idea of how to do it without having to do a heavy query?
Cheers
Ewerton
