就是我想依靠日期控件选择今年的话,在单元格中显示今年该月之前所有的月,
如果选择之前的年份,则显示所有该年所有月份
怎么写呢,大佬们
IF(YEAR($DATE)==YEAR(TODAY()),MAPARRAY(RANGE(1,MONTH($DATE)),CONCATENATE(YEAR($DATE),FORMAT(item,"00"))),MAPARRAY(RANGE(1,12),CONCATENATE(YEAR($DATE),FORMAT(item,"00"))) )
笨办法 用mssql 建个数据集
select mmonth from(
select 1 mmonth union all
select 2 union all
select 3 union all
select 4 union all
select 5 union all
select 6 union all
select 7 union all
select 8 union all
select 9 union all
select 10 union all
select 11 union all
select 12)a where mmonth between 1 and case when year(getdate())='${年}' then month(getdate()) else 12 end
${年} 去做日期的年控件