Getting child course users who may have been disabled when the parent course id was passed in to SIS

SELECT course_id, user_id
FROM [BBLEARN].[dbo].[course_users] child
JOIN [BBLEARN].[dbo].[course_users] parent on parent.child_crsmain_pk1 = child.crsmain_pk1 and parent.users_pk1 = child.users_pk1
JOIN [BBLEARN].[dbo].[course_main] on child.crsmain_pk1 = [BBLEARN].[dbo].[course_main].pk1
JOIN [BBLEARN].[dbo].[users] on [BBLEARN].[dbo].[users].pk1 = child.users_pk1
where child.available_ind = ‘N’ and parent.child_crsmain_pk1 is not null

Getting active uploaders from Panopto

SELECT distinct replace(replace(replace([UserName],'blackboard\',''),'-ac',''),'pau.local\','') as UserName
SELECT [UserName]
((cast((startTime*10000000) as BIGINT)) / CAST(10000 AS bigint)) % 86400000,
DATEADD(day, (cast((startTime*10000000) as BIGINT)) / CAST(864000000000 AS bigint) - 109207, 0)) AS realStartTime
FROM [PanoptoDB_3].[dbo].[activityLog]
JOIN [PanoptoDB_3].[dbo].[aspnet_Users] ON [PanoptoDB_3].[dbo].[aspnet_Users].[UserId] = [PanoptoDB_3].[dbo].[activityLog].[userID]
WHERE [PanoptoDB_3].[dbo].[activityLog].[action] > 0
AND [PanoptoDB_3].[dbo].[activityLog].[SessionId] is not null
) AS t
WHERE realStartTime > '2013-09-01'
order by UserName