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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to add as of today...
Finance forum

How to add as of today range in dynamic query range value

(0) ShareShare
ReportReport
Posted on by 2,426

Good morning,

How can i add dynamic query range to one of field in query to as of today date

(<=today())  as this is not working.

Please provide me solution for this.

Regards,

Have a great day.

I have the same question (0)
  • Suggested answer
    Mahmoud Hakim Profile Picture
    17,887 on at

    Hi 

    you can use (lessThanDate(0))

    check CustOpenInvoicesPastDueListPage query in due date range 

  • Blue Wang Profile Picture
    Microsoft Employee on at
  • Martin Dráb Profile Picture
    240,536 Most Valuable Professional on at

    Note that both previous replies are about the same approach. If you wanted to use currentDate() method mention in the second reply, you would use the syntax shown in the first reply (currentDate()). It just wouldn't handle the operator for you.

    All such methods used to be defined in SysQueryRangeUtil mentioned by Blue Wang (and both currentDate() and lessThanDate() are declared there) but it's not true anymore in F&O. They may be defined in any class, just decorated with QueryRangeFunctionAttribute.

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Thanks Martin.

    I'll learn more about it.

  • Blue Wang Profile Picture
    Microsoft Employee on at

    Share:

    QueryRangeFunctionAttribute corrected by Martin.

    https://lennartconrad.wordpress.com/2016/11/29/how-to-extend-sysqueryrangeutil-in-dynamics-365-for-operations-aka-dynamics-ax7/

    [View:https://community.dynamics.com/365/financeandoperations/b/ievgensaxblog/posts/ax-7-queryrangefunctionattribute-as-a-replacement-for-sysqueryrangeutil:750:50]

  • AX 2012 r3 Profile Picture
    2,426 on at

    Hi martin,

    Thank you for the reply.

    But in d365fo how we can use in dynamic query range as value.?

    Regards

  • Martin Dráb Profile Picture
    240,536 Most Valuable Professional on at

    It's what we discussed in all the replies above.

    Here you have yet another article about the same thing: Using dynamic query values (SysQueryRangeUtil) in Dynamics AX.

  • AX 2012 r3 Profile Picture
    2,426 on at

    Dear Martin,

    The point here is i cannot find in all replies or in the site you mentioned what is value that i can give in query range like

    Range - field - properties - value - Today()    

    (To get only today related records)

    what should i use for <=Today()

    To get as of Today result

    Regards,

    Have a great day.

  • Martin Dráb Profile Picture
    240,536 Most Valuable Professional on at

    I think you got the answer already in the very first reply: (lessThanDate(0)). Please go and try it.

    Later you can return to the articles and try to understand all the options available to you, which will allow you to choose the right method by yourself in future.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans