I don't see why you want to avoid the delta field, as it plays an important part of solving your problem:Problem 1:select entityname ,locationid ,min(timex) as starttime ,max(timex)+59 as endtime from dbo.locationreport2 group by entityname ,locationid ,delta order by entityname ,delta
Problem 2:select entityid ,entityname ,locationid ,min(timex) as starttime ,max(timex)+59 as endtime from dbo.locationreport2 group by entityid ,entityname ,locationid ,delta order by entityid ,delta