将表达式作为参数传递给SSRS中的数据集

时间:2019-03-07 09:53:02

标签: reporting-services dynamics-crm fetchxml

在FetchXml查询中,我将结束日期作为参数传递,但对于“开始日期”,该参数基于用户选择。例如,用户可以选择MTD,QTD和YTD作为报告时间。因此,如果用户选择QTD作为开始日期,而End Date是选择2月的某个日期(例如25日)。因此,我需要将从季度开始创建的记录拉到结束日期中的选定日期。

我可以做些什么,但是从某种意义上说它的值是固定的,如果用户有兴趣选择去年的日期格式该怎么办。

解决方法是使用文本框并根据开始日期和所选值进行排序,然后将此新表达式作为参数传递给数据集。

这些只是假设,我想听听表单专家来整理此查询。

下面是我的FetchXml查询:

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="true" >
    <entity name="account" >
        <attribute name="name" />
        <attribute name="address1_telephone1" />
        <attribute name="fax" />
        <attribute name="accountid" />
        <order attribute="fullname" descending="false" />
        <filter type="and" >
            <condition attribute="createdon" operator="on-or-after" value="" />
            <condition attribute="createdon" operator="on-or-before" value="" />
        </filter>
    </entity>
</fetch>

1 个答案:

答案 0 :(得分:0)

您可以为每种查询类型使用特定的FetchXML Operators

MTD:this-month
QTD:this-fiscal-period
年初至今:this-year

例如:

<filter type="and" >
    <condition attribute="createdon" operator="this-month" />
</filter>
相关问题