Hi,
I have a table view where I need to show data for the last 5 years.
Using last-x-years only includes up to the date time from today (EG 09-20-2016 - 09-20-2021).
How do you filter to include the start of the calendar year (EG 01-01-2016 - 09-20-2021)?
I assumed this was a common scenario but I haven't been able to work it out.
This is for a standard table view filter so I'm looking for a static fetchxml solution instead of computing the exact dates myself in a script/code.
This is for Dynamics 365 Sales.
Thanks for your help!
Hello Sub,
I suggest you to implement fiscal periods. You can Filter out records more than one year.
for more clarification, you can refer this image
Hi,
There is no OOTB operator can achieve your request.
Please refer to the following post:
(+) Date and Time operators in CRM Explained - Microsoft Dynamics CRM Community
If you need to show data for the last year (EG 01-01-2020 - 09-20-2021), it can be achieved with "last-year" operator easily.
But it cannot filter out the data for over 1 year.
You have to set the filter with fixed value.
As the Created On field will be populated automatically with the created date (won't be empty), you only need to set this one condition to filter the records from the beginning of the year 5 years ago to the present.
Or maybe you can create a custom field, calculate the first day of that year five years ago and set it as the value of the field.
Then set it as a condition in FetchXML, but it won't be as easy as filtering with the fixed date and is not recommended.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,524 Super User 2024 Season 2
Martin Dráb 228,469 Most Valuable Professional
nmaenpaa 101,148