I actually have got a doubt regarding usaged of nested queries in Ax. Can we use nested queries or query with in a query in X++ ? Do X++ coding standards agree for nested queries?
use Test
select DISTINCT cust.Name
from CustTable as cust
Where cust.Name in
( select cust2.Name
from CustTable as cust2
where cust2.Address like '450000')
than in Axapta you only be able do this:
static void Job44(Args _args)
{
CustTable Cust, Cust2;
;
while select Name
from Cust2
where cust2.Address like '450000'{
select Name
from Cust
Where cust.Name == cust2.Name;
print Cust.Name;
}
pause;
// select Name from Cust where Cust.Name ==(select Name from Cust2 where Cust2.)
Comments
than in Axapta you only be able do this: }
Use object Query you will get the same result
Wherever possible I prefer to use dynamic queries. If used correctly, they can be significantly quicker than SQL queries. Please refer here for more info - http://www.axaptapedia.com/Expressions_in_query_ranges
I hope this helps,
Long way to go before I sleep..