Finance Path · Mission 21 of 25Expert

Late-posting analysis

Date arithmetic across two TEXT date columns

Back to Finance

The Brief

Jordan ReyesSenior Auditoraudit-review

SOX control — find posted entries where the gap between `txn_date` and `posted_date` is more than 15 days. Columns: `txn_id`, `txn_date`, `posted_date`, `days_late`. Sort by days_late DESC.

You'll practice

Date arithmeticCTEBucketing

Tables available

fact_transactions

Hints (3)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

Cast both columns to date: `posted_date::date - txn_date::date` gives days as an integer in Postgres.

Hint 2

Filter `posted = 1` AND the gap > 15.

Hint 3

Watch out for the one malformed MM/DD/YYYY row and any NULL posted_date — filter them out so the cast doesn't error.