Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to get data from today going back to January 1st of two years ago. Essentially, I want to declare a variable to serve as today's date and then use a sql query to go back to January 1st of two years ago to get the data but not sure how to do this.
may be this
SQL SELECT *
FROM xxxxxxx
WHERE MY_YEAR_FIELD > '01-01-2019';
or this?
Select DateAdd(year, -2, getdate());