首页 > 代码库 > SQl server master

SQl server master

取一段连续时间

 

SELECT  DISTINCT

 

        CONVERT(VARCHAR(7), DATEADD(month, -number,
                                    CONVERT(VARCHAR(11), GETDATE(), 120)), 120) AS NewDate
FROM    master..spt_values
WHERE   type = ‘p‘
        AND number BETWEEN 0 AND 11

SQl server master