Fetching data between two dates

Dear friends,

I have one doubt that,

How to get the data from database between particular from-date to to-date in ax?

Hi,

Can you write a SQL statement -

while select
where

. >=
&&
. <=

through Query…:slight_smile:

Hi Kevin,

Please go through the code for fetching data between two dates using query.

public void init()

{

// TempPayroll localtemppayroll;

queryRun qr;

queryBuildRange qbr,qbr1;

queryBuildDatasource qbds;

;

super();

localtempPayroll = element.args().record();

qr = new SysQueryRun(this);

qbds = qr.query().dataSourceNo(1);

qbr = qbds.addRange(fieldnum(tempPayroll,empId));

qbr.value(localtempPayroll.EmpId);

qbr1 = qbds.addRange(fieldnum(tempPayroll,month));

qbr1.value(localtempPayroll.Month);

qbr.status(rangeStatus::Locked);

qbr1.status(rangeStatus::Locked);

}