# PPAP Status Tracker SQL Query Generator

> Source: https://netray.co/tools/ppap-status-tracker-sql-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Fill in your table and column names and get SQL queries for overdue, pending and rejected PPAP submissions by supplier.

## Category

developer

## Industry

Automotive

## Audience

- Supplier quality engineer
- ERP developer
- Quality systems analyst

## Tool

**Kind:** template

**Output:** code

**Language:** sql

**Fields:**

#### PPAP table name

**Key:** table

**Type:** text

**Default:** ppap_submission

#### Supplier column

**Key:** supplier_col

**Type:** text

**Default:** supplier_name

#### Part number column

**Key:** part_col

**Type:** text

**Default:** part_number

#### Status column

**Key:** status_col

**Type:** text

**Default:** status

#### Due date column

**Key:** due_col

**Type:** text

**Default:** due_date

#### Submitted date column

**Key:** submitted_col

**Type:** text

**Default:** submitted_date

#### Submission level column

**Key:** level_col

**Type:** text

**Default:** submission_level

#### Status value for open

**Key:** pending_value

**Type:** text

**Default:** Pending

#### Status value for rejected

**Key:** rejected_value

**Type:** text

**Default:** Rejected

**Blocks:**

#### Overdue PPAP submissions

**Body:** SELECT {{supplier_col}}, {{part_col}}, {{level_col}}, {{due_col}},
       CURRENT_DATE - {{due_col}} AS days_overdue
FROM {{table}}
WHERE {{status_col}} = '{{pending_value}}'
  AND {{due_col}} < CURRENT_DATE
ORDER BY days_overdue DESC;

#### Open items by supplier

**Body:** SELECT {{supplier_col}},
       COUNT(*) AS open_submissions,
       MIN({{due_col}}) AS earliest_due
FROM {{table}}
WHERE {{status_col}} = '{{pending_value}}'
GROUP BY {{supplier_col}}
ORDER BY open_submissions DESC;

#### Rejected submissions needing resubmission

**Body:** SELECT {{supplier_col}}, {{part_col}}, {{level_col}}, {{submitted_col}}
FROM {{table}}
WHERE {{status_col}} = '{{rejected_value}}'
ORDER BY {{submitted_col}} DESC;

#### Right-first-time rate by supplier

**Body:** SELECT {{supplier_col}},
       COUNT(*) AS total,
       SUM(CASE WHEN {{status_col}} = '{{rejected_value}}' THEN 1 ELSE 0 END) AS rejected,
       100.0 * SUM(CASE WHEN {{status_col}} <> '{{rejected_value}}' THEN 1 ELSE 0 END) / COUNT(*) AS accepted_pct
FROM {{table}}
WHERE {{submitted_col}} IS NOT NULL
GROUP BY {{supplier_col}}
ORDER BY accepted_pct ASC;

**Notes:** Table and column names are generic placeholders because PPAP data is stored differently in each QMS, ERP or custom database. Date arithmetic shown works in PostgreSQL. On SQL Server use DATEDIFF(day, due, GETDATE()) and GETDATE(); on Oracle use TRUNC(SYSDATE) - due. Test on a copy first.

## Content

**Intro:** Supplier quality teams often track PPAP in spreadsheets or a QMS table that no one queries. This generator produces SQL for the four reports people ask for most: overdue items, open items by supplier, rejects and first-time acceptance.

**Sections:**

#### How to use the generator

**Body:** Enter the name of your PPAP table and the columns that hold supplier, part, status, due date and submission level. Match the status values to what your system stores. Copy the queries into your SQL client or a reporting tool. If your PPAP data lives across several tables, create a view first with these generic column names so the queries work as shown.

#### What each query tells you

**Body:** The overdue query ranks items by days late so you can chase the worst first. The open-by-supplier query shows which suppliers hold the most pending packages and the earliest due date. The rejected query lists resubmissions that block launch. The right-first-time query gives a percentage that is useful in supplier scorecards and review meetings.

#### ERP and database notes

**Body:** ERP systems such as SAP QM, Infor SyteLine or Epicor usually do not hold a ready PPAP table, so teams use a custom table, a QMS tool or a SharePoint list synced to a database. Check the real column names in your schema and adjust. Read-only database access is enough for these queries.

#### Common mistakes

**Body:** Do not compare dates stored as text; convert them first. Watch for statuses such as interim approval that are neither pending nor rejected. Make sure resubmissions are not counted as new submissions, otherwise the right-first-time rate will look worse than it is.

**Cta:** If you want PPAP status asked in plain English against your ERP or QMS data, with the query shown, we can help set it up read-only. Contact us.

**Faq:**

#### Will these queries work on my ERP database?

**Answer:** They work on any SQL database once the placeholders match your real table and column names. ERPs rarely have a PPAP table by default, so you may need to point the queries at a custom table or a view you create.

#### How do I handle interim approval status?

**Answer:** Add another condition to the status filters, for example status IN ('Pending', 'Interim'), if you want to treat interim approvals as still open. Decide this with your supplier quality lead so reports stay consistent.

#### Which SQL dialect does this use?

**Answer:** The text is ANSI-style SQL with PostgreSQL date arithmetic. The notes show how to change the date difference for SQL Server and Oracle. Everything else is portable.

#### Can I schedule these as reports?

**Answer:** Yes. Run them from a scheduler, BI tool or database job and send the results to the supplier quality team weekly. Keep the access read-only.

## Search terms

ppap tracker sql, ppap status report query, overdue ppap submissions sql, supplier ppap status dashboard, ppap tracking database, supplier quality sql queries, ppap approval status report, ppap submission log query

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
