dataexport: 18
This data as json
| id | dataQuery | dateCreated | dateLastModified | description | lastChangedUserId | name |
|---|---|---|---|---|---|---|
| 18 | SELECT p.num AS PartNum, CONCAT(lg.name,'-',l.name) AS DisplayLocation, t.num AS TagNum, t.qty, t.qtyCommitted, (t.qty - IFNULL(t.qtyCommitted,0)) AS AvailableQty, ri.dateReceived AS ReceiptDate, poi.unitCost AS PoUnitCost, il_first.eventDate AS FirstInvEventDate, il_first.cost AS InvLogCost, COALESCE(poi.unitCost, il_first.cost) AS ChosenCost FROM part p JOIN tag t ON t.partId = p.id JOIN location l ON l.id = t.locationId JOIN locationgroup lg ON lg.id = l.locationGroupId LEFT JOIN receiptitem ri ON ri.tagId = t.id LEFT JOIN poitem poi ON poi.id = ri.poItemId LEFT JOIN ( SELECT endTagNum, endLocationId, partId, cost, eventDate FROM ( SELECT il.endTagNum, il.endLocationId, il.partId, il.cost, il.eventDate, ROW_NUMBER() OVER ( PARTITION BY il.endTagNum, il.endLocationId ORDER BY il.eventDate ASC, il.id ASC ) AS rn FROM inventorylog il WHERE il.changeQty > 0 AND il.endTagNum IS NOT NULL ) z WHERE z.rn = 1 ) il_first ON il_first.endTagNum = t.num AND il_first.endLocationId = t.locationId AND il_first.partId = t.partId WHERE p.num = '16204-17' AND (CONCAT(lg.name,'-',l.name) = 'Main-ISI' OR l.name = 'Main-ISI') AND t.qty > 0 ORDER BY COALESCE(ri.dateReceived, il_first.eventDate, t.dateCreated) ASC, t.num ASC; | 2026-02-18 09:31:33.105000 | 2026-02-18 09:31:33.105000 | 17 | Return inventory location by PN |