求解:代码如下SELECT CONVERT(VARCHAR(10), DATEADD(DD, number, DATENAME(YY, '${format(年,"yyyy")}'+'0101')+DATENAME(MM, '${format(年,"yyyy")}'+'0101')+'01'), 23) 日期,
substring(DATENAME(DW,CONVERT(VARCHAR(10), DATEADD(DD, number, DATENAME(YY, '${format(年,"yyyy")}'+'0101')+DATENAME(MM, '${format(年,"yyyy")}'+'0101')+'01'), 23)),3,3) 星期
FROM master..spt_values
WHERE type='p' AND number