Report issue

Hi All,

I m creating a report for travel management. In this report I have to fetch data from another database apart from database to which my AX_2009 is pointing.

In this report i have filter data using from_date and to_date.

I had able to connect to other database and data is also fetching fine. But i dont know how to fileter using from_date and to_date .

I Have given the SQL server name , database name and one view. Through that view only i had fetch data.

In fecth method i have written the following code

public boolean fetch()



loginProperty = new loginProperty();

// loginProperty.setDSN(“test”);



odbcConnection = new OdbcConnection(loginProperty);



// sql = ‘Select charged_customer,customer_name,project_name,destination_codes from viewname where viewname.from_date >=’+datetime2str(fromDate);

sql= “Select charged_customer,customer_name,project_name,destination_codes from viewname”;

perm = new SqlStatementExecutePermission(sql);


statement = odbcConnection.createStatement();

resultSet = statement.executeQuery(sql);






// strfmt("%1",date2str(systemdateget(),123,2,-1,2,-1,4))

return true;


Please Help


You can store your resultset in an temporary table in ax and you can filter that with inputs of fromdate and todate.