如题 下拉框预想是有 2019-01 2019-02
=UNIQUEARRAY(MAPARRAY(RANGE(DATEDELTA(today(),-300), DATEDELTA(today(),300)), FORMAT(item, "yyyy-MM")))
参数300根据实际情况调整!
WorkBook7.cpt
select distinct days as day from ( SELECT SUBSTRING(convert(char(10), DATEADD(dd,number,GETDATE()),120),1,7) AS days FROM master..spt_values WHERE type = 'p' AND DATEDIFF(MI,DATEADD(dd,number,GETDATE()),'2035-01-01') > 0)a
sql 写数据字典