Query for date filteration

Hi all,

How can i build the Query range in executeQuery() based on the From and Todate in Query range…EX:Based on the From and ToDate all the value in the form grid should be filtered in the form…

It would help if you explained what exactly you need from us. Now we have to guess and maybe won’t give you want you actually need, which would be a waste of time for both sides.

If you know how to add a range (which should be done on initialization and not in executeQuery()) and you just don’t know how to create a query range value from those two dates, use queryRange() method.

Also, please use more descriptive tags. Don’t use Axapta at all, replace it with your specific version, such as AX 2012. And add tags categorizing your question, such as query, date range or so.

This is my FormA… after providing from and two date based on the date filteration should be done in the form grid…
Now i passed the Two dates to formB by overriding Click()…In formB using Init() i got that element…Now i dont know how to write query to filter the dated in execute query().help me

On classDeclaration

QueryBuildRange qbr;

int init method of yourDataSource after super

qbr = YourDataSourceName_ds.queryBuildDataSource().addRange(fieldnum(yourtable, yourdateField));

in executeQuery before super

qbr.value(queryRange(fromdate, todate));

in init method i dont got the seperate value of From and todate…
public void init()
str a;


Like this i got from formA… Then how could i pass the value in qbr.value(queryRange(fromdate, todate));???

you are asking about how create a range with dates and I am telling you that set on init method of “yourDataSource” after super.

Hi Xbb,
I know that xBB my doubt is how to get from and two date in as two seperate variable??

This is other question but come on which format have the value?


a = “01/01/2015 31/12/2015” ???

If you didn’t consistently ignore what I told you in your two previous threads, you would have an object and you would simply call parmFromDate() and parmToDate() to get those values.

Now you seem to be trying use some string, but because you didn’t tell us what you put into parm(), we can’t tell you how to extract it.

By the way, I already explained to you why you shouldn’t put date values to parm(), but if you insist on finding more complicated ways how to write worse code, well, don’t complain to us…