23-08-21 06:26 AM
23-08-21 05:59 PM
SELECT
s.[name] AS schedule,
tk.[name] AS task,
p.[name] AS process,
ts.resourceName AS [resource],
tr.[period] * CASE tr.unittype WHEN 6 THEN 60 WHEN 1 THEN 60*60 ELSE 0 END AS frequencyMinutes,
tr.startdate,
DATEPART(minute, tr.startdate) AS startTimeOffsetMinutes,
CONVERT(varchar, DATEADD(s, tr.startpoint, 0), 114) AS activePeriodStartTime,
CONVERT(varchar, DATEADD(s, tr.endpoint, 0), 114) AS activePeriodEndTime
FROM BPASchedule s
INNER JOIN BPAScheduleTrigger tr ON s.ID=tr.scheduleID
INNER JOIN BPATask tk ON s.ID = tk.scheduleID
INNER JOIN BPATaskSession ts ON tk.ID = ts.taskID
INNER JOIN BPAProcess p ON ts.processID = p.processID
WHERE tr.usertrigger=1 AND tr.mode=1 AND tr.unittype in (1, 6)
ORDER BY s.[name], tk.[name]
SELECT sessionnumber, processname, runningresourcename, startdatetime, enddatetime, t.[description] AS [status]
FROM BPVSessioninfo s
INNER JOIN BPAStatus t ON s.statusid=t.statusid
ORDER BY sessionnumber DESC
02-09-21 10:12 AM