Detect approved-to-fund anomaly with date comparison
Approved-to-fund (ATF) means an invoice predates the PO — a control failure. Find every PO where invoice_date < po_date.
| Column | Type | Key |
|---|---|---|
| po_id | INT | PK |
| supplier_id | INT | FK → dim_suppliers |
| category_id | INT | FK → dim_categories |
| contract_id | INT | FK → dim_contracts |
| req_date | TEXT | |
| po_date | TEXT | |
| ack_date | TEXT | |
| asn_date | TEXT | |
| gr_date | TEXT | |
| invoice_date | TEXT | |
| qty_ordered | INT | |
| qty_received | INT | |
| unit_price | REAL | |
| contracted_price | REAL | |
| status | TEXT |
Each hint you reveal reduces the XP you can earn. Try the query first.
An invoice that predates its PO is a control failure — find rows where the chronology is reversed.
Project po_id, supplier_id, po_date, invoice_date.
Order by po_date.