and dt between DATEADD(month, -1, ‘2023-06-01 00:00:00’ ) AND DATEADD(month, -1, ‘2023-06-13 23:59:59’) 上列时间范围:是用户输入的时间
举例:用户选择时间:2023-07-01 00:00:00 and 2023-07-13 23:59:59
目前语句输出时间为:2023-05-01 00:00:00.000 and 2023-06-30 23:59:59.000
上月月末
DATEINMONTH(MONTHDELTA(TODAY(),-1),-1)
上月月初
DATEINMONTH(MONTHDELTA(TODAY(),-1),1)
and dt between '${DATEINMONTH(MONTHDELTA(开始日期,-1),1)}' AND '${DATEINMONTH(MONTHDELTA(开始日期,-1),-1)}'
更新
and dt between '${MONTHDELTA(开始日期,-1)}'
${if(DATEINMONTH(结束日期,-1)=结束日期,"and DATEINMONTH(MONTHDELTA('"+开始日期+"',-1),-1)","and MONTHDELTA('"+结束日期+"',-1)")}
正常帆软是这个公式
================
and dt between '${DATEINMONTH(MONTHDELTA(开始日期,-1),1)}' AND '${DATEINMONTH(MONTHDELTA(结束日期,-1),-1)}'
=====================
and dt between '${format(DATEINMONTH(开始日期,1),"yyyy-MM-dd 00:00:00")}' AND '${format(结束日期,"yyyy-MM-dd 23:59:59")}'
时间控件,绑定时间参数
例如筛选起始时间为2023.7.1 结束时间2023.7.13
环比开始:DATEDELTA(2023.7.1,-30)
环比结束:DATEDELTA(2023.7.13,-30)
比如求sales if(and(环比开始<=事实表日期,事实表<=环比结束日期),slaes,null)