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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Passing Date Range parameters in a report AX 2009

(0) ShareShare
ReportReport
Posted on by 1,295

I would like to ask regarding passing date range parameters in AX 2009 I created a report using AX report wizard and then instead of using the standard query, I added a date range field in the report Dialog Box, now I want to use the parameters and not the standard query. Can anyone help me on this? thank you.

Ivan

*This post is locked for comments

I have the same question (0)
  • Verified answer
    SII1MNL Profile Picture
    1,295 on at

    I already found the answer.

    public boolean fetch()

    {

       Table1       _table  ;

      // boolean ret;

       QueryBuildDataSource    qbds;

       Query                               qry;

       QueryRun                         qr;

       ;

       qry =  this.query();

       qbds = qry.dataSourceTable(TableNum(Table1));

       qbds.addRange(fieldNum(Table1, StartDateTime)).value(queryRange(fromDate, toDate));

       qr = new QueryRun(qry);

       while (qr.next())

    {

              _table =  qr.get(TableNum(Table1));

              this.send(_table);

    }

       return true;

    }

  • Ameen1623 Profile Picture
    on at

    Hi Ivan Siason,

     am new to ax 2009....

    i had a doubt in your query range.. how your passing the value of fromdate and todate in the query value?

    pls can you explain me....

  • Suggested answer
    Brandon Wiese Profile Picture
    17,788 on at

    The snippet of code

    queryRange(fromDate, toDate)

    takes the fromDate and the toDate variables and constructs a string that looks something like

    fromDate..toDate

    where the double dot ".." means "between" just like if you used 1..5 or a..e in a query range.

    The queryRange() function is actually found on the Global class.  You can also say Global::queryRange(), but you don't have to.  You can inspect the queryRange() method to see how it works internally, but it should do what you originally wanted.

  • Ameen1623 Profile Picture
    on at

    hi brandon thanks for your quick reply..

    my question is how to pass the current date range value from the report parameter to the query range value..  

    here in the above code simply mentioned as fromdate and todate..

    how to pass the parameter values to fromdate and todate?

    thanks in advance...:)

  • Brandon Wiese Profile Picture
    17,788 on at

    You have to retrieve those dates from the DialogField controls you said you added in the Dialog method, using the .value() property of each one.

  • Ameen1623 Profile Picture
    on at

    i dont know how to retrieve...... am new to the this ax 2009.....

    i created parameters from the query DS ranges.... Can you help me how to retrieve those values.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans