I need to find the last occurence of a date (in my case a static date 1st of may)
I made this which works but i know this can be done in a much smarter way
declare @lastmay date
set @lastmay = DATEADD(YY,YEAR(GETDATE())-2000,'20000501')
IF @lastmay <= GETDATE()
BEGIN
SET @lastmay = DATEADD(YY,-1,@lastmay)
END