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

posted @ 2021-12-15 11:22  丶Ronnie  阅读(225)  评论(0)    收藏  举报