SELECT u.UserName
,u.Email
,u.EmpId
,r.RoleName
,cm.NAME AS [Level]
,u2.UserName [CreatedBy]
,sad.CreatedDate
FROM dbo.SkillApproverDetails sad
INNER JOIN dbo.CenterXPGUXSkill cps ON cps.CenterXPGUXSkillId = sad.CenterXPGUXSkillId
INNER JOIN dbo.Skill s ON s.SkillId = cps.SkillId
INNER JOIN dbo.CenterXPGU cp ON cp.CenterXPGUId = cps.CenterXPGUId
INNER JOIN dbo.PGU p ON p.PGUId = cp.PGUId
INNER JOIN dbo.[User] u ON u.UserId = sad.UserId
INNER JOIN dbo.ROLE r ON r.RoleId = sad.RoleId
INNER JOIN dbo.CRLevelMaster cm ON cm.Id = sad.CRLevelMasterId
INNER JOIN dbo.[User] u2 ON u2.UserId = sad.CreatedBy
WHERE sad.CreatedDate BETWEEN '2016-06-01'
AND '2016-07-31'
ORDER BY sad.CreatedDate
SELECT u.UserName
,u.Email
,u.EmpId
,u.NTId
,r.RoleName
,cm.NAME AS [Level]
,cps.CenterXPGUXSkillId
,s.SkillName
,u2.UserName [CreatedBy]
,sad.CreatedDate
FROM dbo.SkillApproverDetails sad
INNER JOIN dbo.CenterXPGUXSkill cps ON cps.CenterXPGUXSkillId = sad.CenterXPGUXSkillId
INNER JOIN dbo.Skill s ON s.SkillId = cps.SkillId
INNER JOIN dbo.CenterXPGU cp ON cp.CenterXPGUId = cps.CenterXPGUId
INNER JOIN dbo.PGU p ON p.PGUId = cp.PGUId
INNER JOIN dbo.[User] u ON u.UserId = sad.UserId
INNER JOIN dbo.ROLE r ON r.RoleId = sad.RoleId
INNER JOIN dbo.CRLevelMaster cm ON cm.Id = sad.CRLevelMasterId
INNER JOIN dbo.[User] u2 ON u2.UserId = sad.CreatedBy
--WHERE sad.CreatedDate BETWEEN '2016-06-01'
-- AND '2016-07-31'
ORDER BY s.SkillName,r.RoleName
--SELECT * FROM dbo.SkillApproverDetails