aaaa_mobile22.rar
帆软要设置周开始于星期一,并重启服务或者设计器
SELECT
date_value,
DATEPART(YEAR, date_value) AS year_num,
DATEPART(MONTH, date_value) AS month_num,
CASE DATEPART(WEEKDAY, date_value)
WHEN 1 THEN '星期天'
WHEN 2 THEN '星期一'
WHEN 3 THEN '星期二'
WHEN 4 THEN '星期三'
WHEN 5 THEN '星期四'
WHEN 6 THEN '星期五'
WHEN 7 THEN '星期六'
END AS chinese_weekday,
((DATEDIFF(DAY, DATEADD(MONTH, DATEDIFF(MONTH, 0, date_value), 0), date_value) + 6) / 7) + 1 AS week_num
FROM SeptemberDates