Sqlserver
 sql >> Database >  >> RDS >> Sqlserver

Imposta la parte temporale di una variabile datetime

DECLARE @start_date DATETIME
DECLARE @end_date DATETIME

SET @start_date = DATEADD(hour, 20, DATEDIFF(DAY, 2, GETDATE()))
SET @end_date = @start_date + 1

select @start_date, @end_date