sql 报告 - 贡献者审阅者按日期范围创建详细信息

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql 报告 - 贡献者审阅者按日期范围创建详细信息相关的知识,希望对你有一定的参考价值。

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

以上是关于sql 报告 - 贡献者审阅者按日期范围创建详细信息的主要内容,如果未能解决你的问题,请参考以下文章

SQL Server:填写每个实体具有不同日期范围的缺失日期

日期范围报告 - 聚合

如何在 SQL 中为不同月份运行不同的日期范围

SQL 查询 - 多个日期范围

用于显示多个日期范围之间的间隔的 SQL 查询

s-s-rS 13 (SQL 2016) 报告缓存问题