날짜 조회 쿼리

 

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 ))*

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




Posted by woojja
이전버튼 1 2 3 4 5 6 7 이전버튼