Chandrashekar
5/15/2017 - 3:36 PM

Report Participation Report Union

Report Participation Report Union

--Unique active engineers with atleast one completed assessment between dates irrespective of current skill assigned status
SELECT DISTINCT u.FacilityDesc
	,u.UserName
	,u.Email
	,u.Country
	,u.PrimaryRole
	,u.SecondaryRole
	,u.ManagerName
FROM dbo.Assessment a
INNER JOIN dbo.UserCenterXCenterPguSkill ucxps ON a.UserCenterXCenterPguSkillId = ucxps.Id
INNER JOIN dbo.UserXCenter uc ON ucxps.UserXCenterId = uc.UserXCenterId
INNER JOIN dbo.[User] u ON uc.UserId = u.UserId
	AND u.isactive = 1
WHERE a.IsActive = 1
	AND a.AssessmentStatusId = 5
	AND a.CompletedDate BETWEEN '2015-11-01'
		AND getdate()

UNION

--Unique active engineers with atleast one active skill assignment
SELECT DISTINCT u.FacilityDesc
	,u.UserName
	,u.Email
	,u.Country
	,u.PrimaryRole
	,u.SecondaryRole
	,u.ManagerName
FROM dbo.UserCenterXCenterPguSkill ucxps
INNER JOIN dbo.UserXCenter uc ON ucxps.UserXCenterId = uc.UserXCenterId
INNER JOIN dbo.[User] u ON uc.UserId = u.UserId
	AND u.IsActive = 1
WHERE ucxps.IsActive = 1

------------------RMR------------------------
SELECT DISTINCT u.FacilityDesc
	,u.UserName
	,u.Email
	,u.Country
	,u.PrimaryRole
	,u.SecondaryRole
	,u.ManagerName
FROM dbo.[User] u
WHERE u.IsActive = 1