I have been playing around for a while with the following
select dateadd(year,-1,(dateadd(day, -(datepart(day,somedate-1)), (dateadd(day,datediff(day,0,somedate),0)))))
which returns the last day of the previous month.
I need to return the previous year. For example if somedate is...