declare date variable sql

Solutions on MaxInterview for declare date variable sql by the best coders in the world

showing results for - "declare date variable sql"
Alonso
30 Feb 2018
1//The code below will get you a date and time 72 ago.
2DECLARE @HoursAgo DATETIME = DATEADD(HOUR, -72, GETDATE());
3SELECT @HoursAgo AS DaysOrHoursAgo;