标签:first mon convert overflow mes flow question over varchar
PRINT ‘上周的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(WEEK, DATEDIFF(WEEK, 0, GETDATE())-1, 0),120); PRINT ‘本周的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(WEEK, DATEDIFF(WEEK, 0, GETDATE()), 0),120); PRINT ‘上月的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE())-1, 0),120); PRINT ‘本月的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0),120); PRINT ‘上年的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE())-1, 0),120); PRINT ‘本年的第一天:‘+CONVERT(NVARCHAR(20),DATEADD(YEAR, DATEDIFF(YEAR, 0, GETDATE()), 0),120);
标签:first mon convert overflow mes flow question over varchar
原文地址:http://www.cnblogs.com/oufeng/p/7550818.html