SQL To BAQ

Hey everyone,

I’m just having a heck of a time making the below SQL query into a BAQ:

SELECT SalesOrderNumber, TransferOrderNumber, Event, WarehouseCode
FROM dbo.OrderStatus t1
WHERE NOT EXISTS (SELECT 1 FROM dbo.OrderStatus t2 WHERE t1.SalesOrderNumber = t2.SalesOrderNumber and t1.TransferOrderNumber = t2.TransferOrderNumber
and t2.Event NOT IN ('WarehouseOrderFile to EDIWarehouseOrder'))

Any ideas how I can make this in BAQ form?

Order status is a custom view right? Have you tried using an External BAQ for this?

1 Like

Because this is external, I just did this with a view :wink: no need to fuss around with the logic in the BAQ designer!