Change datetime

,

Copy the script and execute. You can change parameter values if you want.

DECLARE @date datetime= '1900-01-30';
DECLARE @datetimeformat INT = 102;
--DECLARE @total_count INT = 10

SELECT 
    LTRIM(RTRIM(CONVERT(char(12), dateadd(day, D.number, @date), @datetimeformat))) As date
FROM
(
    select TOP 20
        CAST((row_number() OVER (ORDER BY (SELECT NULL)) -1) AS int) AS number
    FROM
        sys.all_columns AS AC
        CROSS APPLY
            sys.all_columns AS AC1
        CROSS APPLY
            sys.all_columns AS AC2

) D(number);

Rate

3.67 (3)

Share

Share

Rate

3.67 (3)