可用于按周统计数据的相关需求,返回0~53周
用法 : yearweek(date,[mode]),mode可选填,默认为以周日为当前周的第一天
可选参数:
| Mode | First day of week | Range | Week 1 is the first week … |
| 0 | Sunday | 0-53 | with a Sunday in this year |
| 1 | Monday | 0-53 | with more than 3 days this year |
| 2 | Sunday | 1-53 | with a Sunday in this year |
| 3 | Monday | 1-53 | with more than 3 days this year |
| 4 | Sunday | 0-53 | with more than 3 days this year |
| 5 | Monday | 0-53 | with a Monday in this year |
| 6 | Sunday | 1-53 | with more than 3 days this year |
| 7 | Monday | 1-53 | with a Monday in this year |
本文介绍了一个实用的功能,可用于按周统计数据,返回一年中0到53周的数据。通过使用yearweek函数,可以指定不同的模式来定义一周的开始日,如周日或周一,并确定第一周的条件。该功能适用于各种需要按周进行数据统计和分析的场景。

766

被折叠的 条评论
为什么被折叠?



