l
where 1=1
${if(len(rq) == 0,"","and mydate ='" + FORMAT(MONTHDELTA(rq +"-01",-1),"yyyy-MM") + "'")}
文本标签的公式: FORMAT(MONTHDELTA($rq +"-01",-1),"yyyy-MM")
我录入的是2021-12 。最后你看sql拼出来的数据是2021-11