季节计算脚本
摘要:
DECLARE @date VARCHAR(10), @day INTSET @date=CONVERT(VARCHAR(10),GETDATE(),112)SET @day=(DATEPART(WEEK,SUBSTRING(@date,1,4)+'1231')-48+((DATEPART(WEEKDAY,SUBSTRING(@date,1,4)+'0101')-1)+3)/7)*7SELECT y=YEAR(DATEADD(DAY,-@day,@date)) ,s=(DATEPART(WEEK,DATEADD(DAY,-@day,@date))-1)/13+1 阅读全文
posted @ 2012-04-05 14:23 飞扬的尘埃 阅读(308) 评论(0) 推荐(1) 编辑