mssql 요일 구하기
select count(case when a.days not in ('일요일') then 1 end)
from (
select dateadd(d, number, '2010-08-01') dt
, datename(dw, dateadd(d, number, '2010-08-01')) days
from master..spt_values
where type = 'P'
and number <= datediff(d, '2010-08-01', '2010-08-10')
) a
select count(case when a.days not in ('일요일') then 1 end)
from (
select dateadd(d, number, '2010-08-01') dt
, datename(dw, dateadd(d, number, '2010-08-01')) days
from master..spt_values
where type = 'P'
and number <= datediff(d, '2010-08-01', '2010-08-10')
) a
댓글 없음:
댓글 쓰기