Epicor Open Sales Order Releases SQL Query Generator (Backlog and Past Due)
Backlog, past-due and customer service reports all start at the order release, because that is where required dates live. This generator joins OrderHed, OrderDtl, OrderRel and Customer with the open flags set correctly.
Fill in
Open releases with past due flag
SELECT oh.OrderNum,
od.OrderLine,
orl.OrderRelNum,
c.CustID,
c.Name AS CustomerName,
od.PartNum,
od.LineDesc,
orl.ReqDate,
orl.OurReqQty,
od.UnitPrice,
(orl.OurReqQty * od.UnitPrice) AS ReleaseValue,
CASE WHEN orl.ReqDate < CAST(GETDATE() AS date) THEN 'PAST DUE' ELSE 'OPEN' END AS DueStatus
FROM Erp.OrderHed oh
INNER JOIN Erp.OrderDtl od
ON od.Company = oh.Company
AND od.OrderNum = oh.OrderNum
INNER JOIN Erp.OrderRel orl
ON orl.Company = od.Company
AND orl.OrderNum = od.OrderNum
AND orl.OrderLine = od.OrderLine
INNER JOIN Erp.Customer c
ON c.Company = oh.Company
AND c.CustNum = oh.CustNum
WHERE oh.Company = 'EPIC06'
AND oh.OpenOrder = 1
AND od.OpenLine = 1
AND orl.OpenRelease = 1
AND orl.ReqDate BETWEEN '2026-10-01' AND '2026-12-31'
AND ('[Customer id (blank for all)]' = '' OR c.CustID = '[Customer id (blank for all)]')
ORDER BY orl.ReqDate, oh.OrderNum, od.OrderLine, orl.OrderRelNum;OurReqQty is the required quantity in the inventory unit of measure and UnitPrice is in the order currency, so ReleaseValue is only meaningful per currency. Validate column names for your Kinetic version, and prefer a BAQ for end users so security applies.
Backlog reporting review
Optional: we can review how backlog and past due are reported today and suggest a read-only improvement.
Optional. The tool and every export work without this. No spam.
How to use the generator
Fill in your company, the date window for the required date and, optionally, a customer id. The query returns one row per open release with a past due flag. Paste it into a SQL tool on a replica, or build the same joins in the BAQ designer and publish it as a dashboard. For a weekly backlog, run it with a date range to the end of the quarter and pivot ReleaseValue by month in Excel.
Why the release is the right grain
A line can have several releases with different dates and quantities, for example a blanket order split across months. Counting at the line level hides partial deliveries and misstates past due. The three open flags, OpenOrder, OpenLine and OpenRelease, together say whether anything is left to ship. Using all three avoids listing closed releases on an otherwise open order.
- OrderRel carries the required date
- Use all three open flags
- Group by currency before adding values
Common mistakes
Adding line value and release value together double counts. Using the order date instead of the required date misses the delivery commitment. Another mistake is comparing against GETDATE with a time component, which marks releases due today as past due after midnight is passed on a datetime column. The query casts to date to avoid that. Finally, check whether your business uses ship-by dates, since the ship-by date can differ from the required date.
Frequently Asked Questions
What does OpenRelease mean in Epicor?
OpenRelease marks that the order release still has quantity to ship. When fully shipped or cancelled it is cleared. Combined with OpenLine and OpenOrder, it identifies backlog accurately.
How do I show shipped quantity too?
Join ShipDtl on OrderNum, OrderLine and OrderRelNum and sum the shipped quantity, or use the release's own shipped quantity columns if present in your version. Check the Data Dictionary Viewer.
Can I export this to Excel?
Yes. Run it in a BAQ and use the dashboard export, or run the SQL in a tool that exports results. This page also exports the generated query text to a document.
How do I filter by plant?
Releases can carry a plant or ship-from site. Add a filter on the plant column of OrderRel if your company ships from multiple plants, after confirming the column name in your version.
Netray can place a natural language layer over order and shipment data so customer service can ask for past-due releases without writing SQL, with the query shown for transparency.
Related Tools
Epicor Job Material Shortage SQL Generator
Build a query that lists unissued job material for released, open jobs so planners can chase shortages.
EpicorEpicor Kinetic Database Tables Reference
Look up the main Erp.* tables in Epicor Kinetic with what each holds and the columns that identify a row. Useful when writing BAQs and SQL.
EpicorEpicor Business Object Services Reference
Find the service name and REST path for common Epicor business objects such as JobEntry, SalesOrder and PO.
EpicorEpicor BAQ Performance Tuning Checklist
Work through a practical list of checks when a BAQ, dashboard or BPM lookup runs slowly in Epicor Kinetic.
More Epicor tools
See all- Epicor Kinetic Job Status Reference
- Epicor BAQ Query Template Generator
- Epicor BPM Directive Design Template
- Epicor DMT Import Template Worksheet (Part and BOM)
- Epicor MRP Run Checklist
- Epicor Kinetic Upgrade Checklist
- Epicor REST API v2 URL Builder
- Epicor Security Group Design Worksheet
- Epicor Safety Stock and Reorder Point Calculator