06-11-20 08:11 AM
Answered! Go to Answer.
06-11-20 03:38 PM
select s.Name, SLE.TerminationReason, DATEADD(hour,-12,ASL.starttime) as starttime ,DATEADD(hour,-12, ASL.endtime) as endtime
from [dbo].[BPAScheduleLogEntry] SLE
inner join [dbo].[BPVAnnotatedScheduleLog] ASL
on SLE.[schedulelogid] = ASL.[id]
inner join [dbo].[BPASchedule] S
on S.id = ASL.scheduleid
and entrytime >= DATEADD(hour,-24, GETDATE())
and terminationreason is not null
and entrytype = '5'
and endtime is not null
order by ASL.starttime
06-11-20 03:38 PM
select s.Name, SLE.TerminationReason, DATEADD(hour,-12,ASL.starttime) as starttime ,DATEADD(hour,-12, ASL.endtime) as endtime
from [dbo].[BPAScheduleLogEntry] SLE
inner join [dbo].[BPVAnnotatedScheduleLog] ASL
on SLE.[schedulelogid] = ASL.[id]
inner join [dbo].[BPASchedule] S
on S.id = ASL.scheduleid
and entrytime >= DATEADD(hour,-24, GETDATE())
and terminationreason is not null
and entrytype = '5'
and endtime is not null
order by ASL.starttime
06-11-20 03:48 PM
Select
L.id,
Case When S.name Is Not Null Then S.name Else S.deletedname End [Name],
L.servername,
Min(Case When E.entrytype = 0 Then E.entrytime Else Null End) [Start_Time],
Max(Case When E.entrytype = 1 Or E.entrytype = 2 Then E.entrytime Else Null End) [End_Time],
Min(Case When E.entrytype = 2 Or E.entrytype = 5 Or E.entrytype = 8 Then 1 Else Null End) [Had_Error]
From
BPASchedule S
Inner Join BPAScheduleLog L On
S.id = L.scheduleid
Inner Join BPAScheduleLogEntry E
On
L.id = E.schedulelogid
Group By
L.id,
Case When S.name Is Not Null Then S.name Else S.deletedname End,
L.servername
06-11-20 06:49 PM
06-11-20 07:13 PM