简体   繁体   中英

Filter Dataset Result based on Parameter Value

I am working on Microsoft Dynamics Reporting service. My requirement is to show records which is dated 3 years or earlier from a given date. The parameter I have is a date selection field. What I am trying to achieve is get records based on my condition from the date I have selected on the parameter.

To filter data based on the current date, I can use:

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

But, to get the data filtered based on the parameter value is what I can't figure out.

Can someone help me with this?

You should use between operator, but in fetchxml you can achieve it this way.

<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>

Also expression can help you to calculate and pass parameters.

We can add a dynamic date for the report. We can add another date which will have a custom code to have a date 3 years prior to the input date or current date. This date can be referenced to the FetchXML query to filter the records.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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