티스토리 뷰


select    replace(convert(char(10),dateadd(d,datepart(dw,'2015-08-06') * -1 - 5,'2015-08-06'),120),'-','') AS P_MON,

          replace(convert(char(10),dateadd(d,datepart(dw,'2015-08-06') * -1 + 1,'2015-08-06'),120),'-','') AS P_SUN,

          replace(convert(char(10),dateadd(d,datepart(dw,'2015-08-06') * -1 + 2,'2015-08-06'),120),'-','') AS MON,

          replace(convert(char(10),dateadd(d,datepart(dw,'2015-08-06') * -1 + 8,'2015-08-06'),120),'-','') AS SUN;



댓글