Ax joins and query

Hi All,

I want to write a AX join query. In the customer table, we have customer chain. For all the customers related to particular chain, AX should select all the records from Invent Trans and invent Trans should have pickingRouteId and invoiceId should not be present. Can any one suggest me how to retrieve the records matching this condition and Whether query will be ideal to use or while select.

EX -

Customer chain - 1545

select all customers from custTable where customer chain is 1545. Suppose the customers are A,B and C. Now for these three customers, Ax should select all the records from inventTrans which has PickingRouteId but not InvoiceId.

Thanx in Advance.