Convert day-first dates with the right locale (consultancy)
Claim dates are written 05/03/2026 meaning 5 March. Convert them to real dates using the en-GB culture.
- 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
Use a culture when converting text to dates so day and month aren't swapped.
Brightline Advisory (fictional) reimburses consultants' expenses. Finance exports claims monthly from the expense tool.
Steps
- Use the first row as headers.
ClaimDateis written day/month/year. Convert it to a date using theen-GBculture.- Set
Amountto a decimal number. - Keep only
ClaimID,ClaimDateandAmount.
Your result must
- ClaimDate is a date type
- 05/03/2026 becomes 5 March 2026, not 3 May
- Columns: ClaimID, ClaimDate, Amount
Input
- ClaimsFile (file)
- Text file; first line: ClaimID,Employee,ClaimDate,Amount
- Every field is text until you set types
Expected output columns
ClaimID (text), ClaimDate (date), Amount (number)
| ClaimID | ClaimDate | Amount |
|---|---|---|
| C-0001 | 2026-05-27 | 383.69 |
| C-0002 | 2026-06-28 | 111.09 |
| C-0003 | 2026-01-22 | 285.99 |