Here is one solution :
if OBJECT_ID('tempdb..#t') is not null
drop table #t
select * , ROW_NUMBER() over ( partition by batch order by batch, tag) no into #t from events
select s.batch, tag, min , max from
(select max(no) no, MIN(pcdatelogged) min , MAX(pcdatelogged) max , batch from #t group by batch) s
join #t on #t.no = s.no and #t.batch = s.batch
Convert it to a stored procedure and retrieve data with a suitable datasource.
Hope it helps.