How to give from and to date range in a query through code?

Hi all,

I am new to AX and I have come across a situation where an user after giving a date range form the query dialog box.

So, how should I have access to that date range in two separate variables viz. FromDate and ToDate respectively through code in fetch method of that report. In other words how can I hold those two dates in two separate variables?

Also I have one more doubt related to same situation. Suppose, I need to give those date ranges through code in fetch method, then, how can I achieve this?

Thanks and Regards

Have a look at VendAccountStatementInt report for inspiration

vendTransDataSource.addRange(fieldnum(VendTrans,TransDate)).value(queryRange(fromDate, toDate));

Hi Kiran,

After I have written that code,I want to display the That fromdate and todate on The Report.

Please Help Me.

Regards,

Murali.