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‘);
时间: 2024-11-05 14:37:44