This query identified Parts that are inventories but are missing their entry in the Inventory table for a particular warehouse. Within Control, editing and saving these parts will automatically recreate the missing entries.
None. This is a selection query and no data is modified in the running of it.
SELECT P.ID AS PartID, P.ItemName AS PartName, W.ID AS WarehouseID, W.WarehouseName FROM Part P, Warehouse W WHERE P.ID > 0 AND P.TrackInventory = 1 AND W.ID > 0 AND NOT EXISTS (SELECT ID FROM Inventory I WHERE I.PartID = P.ID AND I.WarehouseID = W.ID)