sql输出期间内的所有日期
SELECT
convert(char(10), DATEADD(dd,number,'2021-04-07 09:11:00.000'),120) AS yyyymmdd
FROM
master..spt_values
WHERE
type = 'p'
AND DATEDIFF(MI,DATEADD(dd,number,'2021-04-07 09:11:00.000'),'2021-04-18 09:11:00.000') > 0
SELECT
convert(char(10), DATEADD(dd,number,'2021-04-07 09:11:00.000'),120) AS yyyymmdd
FROM
master..spt_values
WHERE
type = 'p'
AND DATEDIFF(MI,DATEADD(dd,number,'2021-04-07 09:11:00.000'),'2021-04-18 09:11:00.000') > 0