不幸的是,now() 正在创建一个不支持所有 JODA 方法的内部日期/时间对象(我们将在下一个版本中添加它们)。同时,这里有几种计算月末的方法:
with
// Be aware it is the server's end of month not the client, if you don't see the problem you've been lucky...for the time being.
// using MDX functions ( function can be added to the schema )
function ic3_EOM() as DateTime( now().year() , now().month() +1, 1 )->plusDays(-1)
// using JODA DateTime ( function can be added to the schema )
function ic3_EOM_2() as J!org.joda.time.DateTime()->plusMonths(1)->withDayOfMonth(1)->minusDays(1)->toLocalDate()
member [ic3_EOM] as ic3_EOM()
member [ic3_EOM_2] as ic3_EOM_2()
select { [ic3_EOM], [ic3_EOM_2] } on 0 from [sales]