Query · SQL
Inventory aging — days since receipt
How long on-hand inventory has been sitting, based on receipt dates — to surface slow-movers and stale stock.
What people ask
- How old is my inventory?”
- Days since my inventory was received”
- Show me an inventory aging report based on receipt dates”
The query
inventory-aging.sql
SELECT part.num AS part_number, part.description, tag.dateCreated AS date_received, DATEDIFF(CURRENT_DATE, tag.dateCreated) AS days_old FROM part JOIN tag ON part.id = tag.partId WHERE tag.typeId > 10 ORDER BY days_old DESC;
Preview · demo data
| Part # | Description | Date received | Days old |
|---|---|---|---|
| GEAR-88 | Gear set 88T | 2025-09-12 | 281 |
| SEAT-05 | Saddle, sport | 2026-02-03 | 137 |
| CHAIN-12 | Chain, 12-speed | 2026-05-20 | 31 |
Notes & gotchas
- tag.typeId > 10 limits to inventory tags (excludes labor/service).
- This simple version uses tag.dateCreated. For parts with multiple receipts, a FIFO variant attributes on-hand qty to specific PO receipts for accurate aging.
- Sorting by days_old descending puts your oldest stock first — the win for cycle-count and write-off decisions.
How old is my on-hand inventory — days since it was received?
Agent Query session
There are two ways: a quick tag-level snapshot, or a FIFO version that ties on-hand quantity to specific PO receipts. I'll start with the simple one — it's enough when parts come from a single receipt.
inventory-aging.sql
SELECT part.num AS part_number, part.description, tag.dateCreated AS date_received, DATEDIFF(CURRENT_DATE, tag.dateCreated) AS days_old FROM part JOIN tag ON part.id = tag.partId WHERE tag.typeId > 10 ORDER BY days_old DESC;
Agent Query session
Here's the snapshot on demo data, oldest first. If your parts receive in multiple batches and you need exact aging, say the word and I'll switch to the FIFO-allocated version.
| Part # | Description | Date received | Days old |
|---|---|---|---|
| GEAR-88 | Gear set 88T | 2025-09-12 | 281 |
| SEAT-05 | Saddle, sport | 2026-02-03 | 137 |
| CHAIN-12 | Chain, 12-speed | 2026-05-20 | 31 |
Want one like this for your Fishbowl?
Send a short brief — an ILC expert builds and tests it, and you get the file ready to import. The quote is free.