How do I get revolving last 12 months in T-SQL 2005?

sql, sql-server, sql-server-2005, t-sql

Solution

You can do date arithmetic with dateadd, e.g. `where MY_DATE > dateadd (yy, -1, getdate())`

Problem

At the moment I use DATEPART(yy, MY_DATE) = DATEPART(yy, GETDATE()) to get Year-To-Date details and have to convert it into the revolving last 12 months. How would I do that?

Original source