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?
+4
A:
You can do date arithmetic with dateadd, e.g. where MY_DATE > dateadd (yy, -1, getdate())
ConcernedOfTunbridgeWells
2009-06-26 07:43:54
This is exactly what I was going to put.
Garry Shutler
2009-06-26 08:01:05
Thanx a million!
Greg
2009-06-26 09:51:09