${if(len(month) == 0,"","and month in ('" +LEFT(DATE_SUB(concat('${jhyd}','-01'),INTERVAL 1 YEAR),7)+ "')")}
MONTHDELTA(date,delta):返回指定日期date后delta个月的日期。
示例:
MONTHDELTA("2008-08-08",4)等于2008-12-08。
${if(len(month) == 0,"","and month in (LEFT(DATE_SUB(concat('"+jhyd+"','-01'),INTERVAL 1 YEAR),7))")}
不管是多选还是单选你这都是错的:多选错得多(数组),单选错得少(没数组)
建议你把jhyd在A1单元格个扩展,B1单元格写公式:FORMAT(YEARDELTA(CONCATENATE(A1,"-01"),-1),"yyyy-MM"),b2写公式JOINARRAY(A1,"','")
${if(len(month) == 0,"","and month in ('"+b2+"')")}