Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql server current date minus 5 years

SELECT GETDATE() 'Today', 
           DATEADD(day,-2,GETDATE()) 'Today - 2 Days'
SELECT GETDATE() 'Today', 
           DATEADD(dd,-2,GETDATE()) 'Today - 2 Days'
SELECT GETDATE() 'Today', 
           DATEADD(d,-2,GETDATE()) 'Today - 2 Days'
Source by sqlhints.com #
 
PREVIOUS NEXT
Tagged: #sql #server #current #date #years
ADD COMMENT
Topic
Name
3+4 =