PREVIOUS_DAY
Returns the date of the most recent specified day of the week before the given date or timestamp.
Syntax
PREVIOUS_DAY(<date_expression>, <target_day>)
Return Type
Date.
Examples
If you need to find the previous Friday before a given date, such as 2024-11-13:
SELECT PREVIOUS_DAY(to_date('2024-11-13'), friday) AS last_friday;
┌─────────────┐
│ last_friday │
├─────────────┤
│ 2024-11-08 │
└─────────────┘