declare date variable sql

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

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
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;