web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 Filter by Grid - Using dates

(0) ShareShare
ReportReport
Posted on by

I have filterd by grid enabled on all forms. Now I want to filter on Date-Time fields. How can I filter all records by getting following results:

* All records where modify date between yesterday and now

* All records where modify date within the current month / year

* All records where modify date is today - 5 days untill now

* All records where modify date is previous week

...

Is this possible? Can I use e.g. "Today()-5 .. Today()" in a filter?

Regards,

Luk

*This post is locked for comments

I have the same question (0)
  • Verified answer
    dolee Profile Picture
    11,279 on at

    Hi Luk,

    Please refer to this page:

    technet.microsoft.com/.../aa569937.aspx

    At the bottom of the table it mentions that "Type a SysQueryRangeUtil method with parameters that specify the value or range of values." with an example.

    You can then refer to the SysQueryRangeUtil class in AX. The "greaterThanDate" and "dayRange" methods seems to fit your needs, but there are other methods there that may fit better.

    Cheers.

  • Verified answer
    Martin Dráb Profile Picture
    239,163 Most Valuable Professional on at

    You can use methods from SysQueryRangeUtil class for such scenarios (and add new methods if something can't be done with the existing ones).

    Example: (dayRange(-5, 0))

    Don't forget the outer parentheses, they're important there.

  • Ragnar Páll Profile Picture
    25 on at

    Hi,

    Can methods in SysQueryRangeUtil take parameters, like tablerecord. I whould like to compare two fields in record.

    Wbr,

    Ragnar Páll

  • dolee Profile Picture
    11,279 on at

    Hi Ragnar,

    Like Martin said, you can extend SysQueryRangeUtil with your own method. And these methods can take parameters. However, I don't think you can specify a "tablerecord" as a parameter...more likely you'll be passing in the unique key field(s) to your method to find the records. Then build a query range from that.

    Cheers.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans