날짜 조회 쿼리

 

SELECT CONVERT(CHAR(10),DATEADD(d,number,'2012-01-01'),120) dt,
    DATENAME(dw,DATEADD(d,number,'2012-01-01')) dn,
    DATEPART(dw,DATEADD(d,number,'2012-01-01')) dp
FROM MASTER..SPT_VALUES
WHERE TYPE = 'P' AND number <= DATEDIFF(d,'2012-01-01','2013-12-31')

 

행복한 고수되셔요~

woojja ))*

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

반응형

+ Recent posts