简体   繁体   English

SSRS Report Builder 3.0 MDX时间/日期参数默认值

[英]SSRS Report Builder 3.0 MDX Time/Date Parameter Default Value

I have been struggling with this all week and have yet to find an answer. 我整个星期都在努力挣扎,但尚未找到答案。 I have a fairly simple report with an Analysis Services Cube as the Data Source. 我有一个相当简单的报告,其中有Analysis Services多维数据集作为数据源。

I am attempting to set the TimeDate parameter's default value to the previous date. 我试图将TimeDate参数的默认值设置为上一个日期。 I am familiar with how to do this normally, but am having difficulty with MDX. 我熟悉如何正常执行此操作,但是在使用MDX时遇到了困难。

The following expressions does work, but pulls 1/8/2011 as the Cube's data value are based on the number of days since 1/1/2011 (eg the value '1136' generates 2/9/2014). 以下表达式确实起作用,但由于多维数据集的数据值基于自2011年1月1日以来的天数,所以提取1/8/2011(例如,值“ 1136”生成2/9/2014)。

="[Time Date].[Date].&["+DAY(CSTR(DAY(NOW())+"]"

The following should work: 以下应该工作:

="[Time Date].[Date].&[" + DateDiff(DAY, Date(2011, 1, 1), Today()) + "]"

See http://technet.microsoft.com/en-us/library/aa337092.aspx for the date functions of Reporting Services. 有关Reporting Services的日期功能,请参见http://technet.microsoft.com/zh-cn/library/aa337092.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM