标签:from sel arch val where rom date() get value
SELECT CONVERT(VARCHAR(10), DATEADD(dd, number,
CONVERT(VARCHAR(8), GETDATE(), 120)
+ ‘01‘), 120) AS dt
FROM master..spt_values
WHERE type = ‘P‘
AND DATEADD(dd, number,
CONVERT(VARCHAR(8), GETDATE(), 120)
+ ‘01‘) <= DATEADD(dd, -1,
CONVERT(VARCHAR(8), DATEADD(mm,
1, GETDATE()), 120)
+ ‘01‘);
标签:from sel arch val where rom date() get value
原文地址:http://www.cnblogs.com/alwaysonline/p/6168617.html