Date Difference for Age Calculation

Medium
date-functions Instacart Amazon DoorDash

Write a query to calculate how many days ago each order was placed relative to '2025-04-01'. Return order_id, order_date, and days_ago, ordered by days_ago.

Expected Output: Orders with the number of days between order date and reference date.

Tables

Hints (2 available)

SQL Editor

Output

Click "Run" to see results...