Results:
The 2020-05-01
The 2020-05-02
The 2020-05-03
The 2020-05-04
The 2020-05-05
CodePudding user response:
What are the useful function can supportCodePudding user response:
declare @ time1 datetime, @ time2 datetime
The set @ time1=getdate ()
The set @ time2=DATEADD (DAY 5, getdate ())
Select @ time1, @ time2
/* result
The 2020-05-15 15:18:56. 990 2020-05-20 15:18:56. 990 */
The select DATEADD (DAY, number, @ time1) from the master.. Spt_values
Where type='P' and number between 0 and DATEDIFF (DAY, @ time1, @ time2)
/* result
The 2020-05-15 15:18:56. 990
The 2020-05-16 15:18:56. 990
The 2020-05-17 15:18:56. 990
The 2020-05-18 15:18:56. 990
The 2020-05-19 15:18:56. 990
The 2020-05-20 15:18:56. 990 */