Filter orders to a date window from a parameter table (kite shop)
A one-row Settings table holds StartDate and EndDate. Keep orders inside that window, both ends included.
- Level
- intermediate
- Time
- ~8 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Filter with values read from another query instead of typed constants.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
Settingshas one row withStartDateandEndDate(dates).- Convert
OrderDateto a date, then keep orders on or after StartDate and on or before EndDate. - Keep all columns. Don't type any dates into the query.
Your result must
- Orders on StartDate and on EndDate are kept
- Nothing outside the window
- Changing Settings changes the result
Input
- Orders (table)
- OrderID: text
- Customer: text
- Region: text
- Product: text
- Qty: number
- UnitPrice: number
- OrderDate: text
- Status: text
- Settings (table)
- StartDate: date
- EndDate: date
Expected output columns
OrderID (text), Customer (text), Region (text), Product (text), Qty (number), UnitPrice (number), OrderDate (date), Status (text)
| OrderID | Customer | Region | Product | Qty | UnitPrice | OrderDate | Status |
|---|---|---|---|---|---|---|---|
| 0003 | Sven Silva | South | Reel | 7 | 4.26 | 2026-01-10 | Complete |
| 0004 | Bao Quist | North | Delta Kite | 9 | 7.71 | 2026-01-02 | Cancelled |