按周分组天 sql server / ssrs
我将重新表述我之前提出的一个问题。
我想按周对日期进行分组。我目前有两个函数:第一个函数返回一年中的所有会计周,第二个函数返回所有日期。
我在财政周中进行了左外连接以获得此结果集。
4/4/2010 4/4/2010 NULL 5/4/2010 NULL 6/4/2010 ... 11/4/2010 11/4/2010 NULL 12/4/2010
在 SSRS 中,我想按周对天进行分组,因此我需要具有日期所属会计周的空值,关于如何执行此操作有什么想法吗?
I'm going to rephrase a question that I prevously had asked.
I want to group dates by week. I currently have two functions: The first of which returns all fiscal weeks of the year and the second all the dates.
I do a left outer join on the Fiscal weeks from the days to get this result set.
4/4/2010 4/4/2010 NULL 5/4/2010 NULL 6/4/2010 ... 11/4/2010 11/4/2010 NULL 12/4/2010
In SSRS, I want to group the days by weeek, so I need to have the Null values having the fiscal week that the dates are part of, any ideas of how to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了另一种方法来填补空白。这是通过使用 SQL 中的 datepart 函数返回周数。
返回星期数。然后,我在 SSRS 中周列的单元格中做了进一步的表达式,使其与原始财务周数一致,现在已经有了。
这允许我在 SSRS 中按周分组。
I found an alternative way to fill the null. This was by using the datepart function within SQL to return the week number.
Which returns the number of the week. I then did a further expression in the cell for the week column in SSRS, to make it co-align with orignal fiscal week number and now have.
Which allows me to group by week in the SSRS.