Reports

in reports i want to compare two tables and fetch the latest trans date how can i do it

which two tables are you talking about? Do you have Atlas XL installed?

What are the fields are there in the two table?

What is the relation?

In what scenario, you want to fetch the data?

Hi Shuheng,

What is Atlas Xl and why we need that in Ax…

Atlas XL can make your AX life easier when joining tables or exporting reports.

http://www.atlasxl.com.au/Globeportal/1home.aspx

Thanks buddy…:slight_smile:

Go through this code and try to implement your logic,

static void comparision_of_dates(Args _args)
{
Transdate x,y;
Container con;
str test,_date2;
;
x = 31\12\2010;
y = 30\11\2010;

test = date2str(x,123,2,-1,2,-1,4);
_date2 = date2str(y,123,2,-1,2,-1,4);

con = conins(con,1,substr(test,1,2));
con = conins(con,2,substr(test,4,2));
con = conins(con,3,substr(test,7,4));
con = conins(con,4,substr(_date2,1,2));
con = conins(con,5,substr(_date2,4,2));
con = conins(con,6,substr(_date2,7,4));

if((conpeek(con,3))>(conpeek(con,6)))
{
info(strfmt(“The greater date is %1”,test));
}
else if((conpeek(con,3))==(conpeek(con,6)))
{
if((conpeek(con,2))>(conpeek(con,5)))
{
info(strfmt(“The greater date is %1”,test));
}
else if((conpeek(con,2))==(conpeek(con,5)))
{
if((conpeek(con,1))>(conpeek(con,4)))
{
info(strfmt(“The greater date is %1”,test));
}
else
{
info(strfmt(“The greater date is %1”,_date2));
}
}
else
{
info(strfmt(“The greater date is %1”,_date2));
}
}
else
{
info(strfmt(“The greater date is %1”,_date2));
}

}