Home Forums SQL Server 2008 T-SQL (SS2K8) GetDate() 5 Years ago without time formated 'YYYY-MM-DD' RE: GetDate() 5 Years ago without time formated 'YYYY-MM-DD'
MMartin1
One Orange Chip
Points: 27768
More actions
July 12, 2013 at 12:18 pm
#1632107
Create a date variable , assign the value of CONVERT(DATE, DateAdd(yy, - 5, GetDate())) to the variable and use the variable instead in your query. This may be more efficient.
CONVERT(DATE, DateAdd(yy, - 5, GetDate()))
----------------------------------------------------