在FetchXml Query中,我将结束日期作为参数传递,但对于Start Date,参数基于用户选择。例如,用户可以选择MTD,QTD和YTD作为报告时间。因此,如果用户选择QTD作为开始日期,结束日期则选择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>
您可以为每种查询类型使用特定的FetchXML Operators:
MTD:this-month
QTD:this-fiscal-period
YTD:this-year
例如:
<filter type="and" >
<condition attribute="createdon" operator="this-month" />
</filter>