How to write SQL query in AX 4.0 using Query, QBDS.

Hi All,

I have the following query which I need to use in AX.

SELECT
INVENTTABLE.ItemId,
INVENTTABLE.CustAccount,
RouteOpr.OprId,
RouteOpr.RouteRelation,
RouteOpr.pmf_CustName,
RouteOpr.ProcessTime,
RouteOpr.ProcessPerQty

FROM dbo.INVENTTABLE
JOIN RouteOpr ON RouteOpr.ItemRelation = INVENTTABLE.ItemId
WHERE INVENTTABLE.CustAccount IN (‘107708’)
AND
RouteOpr.OprId = ‘Rack’
order by INVENTTABLE.ITEMID.

It looks quite straightforward, what problem do you have with it?

Note that you can replace IN() with simple comparison; IN() doesn’t add any value there if it contains a single element only.

Hi Martin,

I want to replicate the same using Query classes (QBDS).

Thank You

Yes, I understand that. But what do you need from us?

I assume that you tried to do it and ran into a problem, but you still haven’t told us what it is.

If you want somebody to do all the work for you and you’ll do nothing, you should change your approach…