Previous Thread

8/17/2006 6:25:02 AM    Inner select
Can i do an inner select in axapta 
 
Something like 
 
select instance 
 
where instance.field in (select field from instance2 where 
 
instance2.field2 == value); 
 
Thx



8/17/2006 3:43:04 PM    Re: Inner select
Yes. 
 
From the Axapta developer's guide: 
 
Inner join: selects records from the main table that have matching records 
 
in the joined table - and vice versa. 
 
In other words, you get one record for each match and records without 
 
related records are eliminated from the result. 
 
static void Job37(Args _args) 
 
{ 
 
CustTable   custTable; 
 
CustTrans   custTrans; 
 
AccountNum  accountNum; 
 
; 
 
accountNum = "100000"; //set a valid account number here. 
 
while select custTable 
 
join AmountMST from custTrans 
 
where custTable.AccountNum == custTrans.AccountNum  && 
 
custTable.AccountNum == accountNum 
 
{ 
 
info(strfmt("%1", custTrans.AmountMST)); 
 
} 
 
} 
 
Regards, 
 
Anton 
 
"MrBeen" <MrBeen@discussions.microsoft.com> wrote in message 
 
news:BF6ED1DB-CF23-47E8-B5C0-4076328A39F4@microsoft.com...