Open JanSrp opened 1 year ago
SELECT Time=time
,ActivitiesCompletedInHour=count(*)
FROM (select SET_TIME,time=FORMAT(SET_TIME, 'yyyy-MM-dd HH') from [dbo].[JOB_HISTORY]
union all
select SET_TIME,time=FORMAT(SET_TIME, 'yyyy-MM-dd HH') from[TotalAgility_FinishedJobs].[dbo].[FINISHED_JOB_HISTORY]) j
where SET_TIME between DATEADD(day,-1,getdate()) and getdate()
group by time
order by time desc
SELECT Time=time
,ActivitiesCompletedInHour=count(*)
FROM (select SET_TIME,time=FORMAT(SET_TIME, 'yyyy-MM-dd HH') from [dbo].[JOB_HISTORY]
union all
select SET_TIME,time=FORMAT(SET_TIME, 'yyyy-MM-dd HH') from[TotalAgility_FinishedJobs].[dbo].[FINISHED_JOB_HISTORY]) j
where SET_TIME between DATEADD(day,-1,getdate()) and getdate()
group by time
order by time desc