All examples
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.

Type: Query Output: TableData: Demo sandbox

What people ask

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

3 rows · demo data
Part #DescriptionDate receivedDays old
GEAR-88Gear set 88T2025-09-12281
SEAT-05Saddle, sport2026-02-03137
CHAIN-12Chain, 12-speed2026-05-2031

Notes & gotchas

A locked session — the real conversation that produced this report. Open it in the app to fork and continue.
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.

preview · demo data
Part #DescriptionDate receivedDays old
GEAR-88Gear set 88T2025-09-12281
SEAT-05Saddle, sport2026-02-03137
CHAIN-12Chain, 12-speed2026-05-2031

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.

Related examples