sqlserver中提取去年的同一天或某月

已知今天5月12日,想要提取去年5月1日到5月11日数据,应该怎么写,

想要自动的用日期公式

使用dateadd来计算。
select dateadd(year,-1,CONVERT(varchar(7),getdate(),120)+'-01') 去年本月第一天,
dateadd(year,-1,getdate()-1) 去年昨天有时间,
convert(varchar(10),dateadd(year,-1,getdate()-1),120) 去年昨天不带时间


select * from 表名 where data between 2020-5-1 and 2020-5-11