/* ************************************************ * * 일별 통계 구하기 : 2017-07-01 ~ 2017-07-31 * ************************************************ */ WITH CTE_MONTHS AS (SELECT '2017-07-01' AS THIS_DATE UNION ALL SELECT CONVERT(VARCHAR(10), DATEADD(DAY, 1, THIS_DATE), 120) AS THIS_DATE FROM CTE_MONTHS WHERE (CONVERT(VARCHAR(10), DATEADD(DAY, 1, THIS_DATE), 120)