根据参数值过滤数据集结果

Filter Dataset Result based on Parameter Value

我正在处理 Microsoft Dynamics Reporting 服务。我的要求是显示从给定日期起 3 年或更早的记录。我的参数是一个日期选择字段。我想要实现的是根据我在参数上选择的日期的条件获取记录。

要根据当前日期过滤数据,我可以使用:

<condition attribute="modifiedon" operator="olderthan-x-months" value="36" />

但是,根据参数值过滤数据是我想不通的。

有人可以帮我解决这个问题吗?

你应该使用 between 运算符,但在 fetchxml 中你可以这样实现。

<filter type="and">
  <condition attribute="modifiedon" operator="on-or-after" value="2016-10-04" />
  <condition attribute="modifiedon" operator="on-or-before" value="2019-10-03" />
</filter>

表达式也可以帮助你计算和传递参数。

我们可以为报告添加动态日期。我们可以添加另一个日期,该日期将具有自定义代码,使日期早于输入日期或当前日期 3 年。此日期可参考 FetchXML 查询以过滤记录。