반응형

[MSSQL] 특정 기간에 해당하는 모든 날짜 (MASTER..SPT_VALUES) 

 

 

SELECT CONVERT(VARCHAR, DATEADD(D, NUMBER, '20170213'), 112) AS 'DATE' 
FROM MASTER..SPT_VALUES 
WHERE TYPE = 'P' AND NUMBER <= DATEDIFF(D, '20170213', '20170730')
반응형

+ Recent posts