NEXT_DAY
Learn how to use the NEXT_DAY datetime function in PlaidCloud Lakehouse. Returns the date of the upcoming specified day of the week after the given date or...
Returns the date of the upcoming specified day of the week after the given date or timestamp.
Analyze Syntax
func.next_day(date_expression>, <target_day>)
Analyze Examples
func.next_day(func.to_date('2024-11-13'), 'monday')
┌──────────────────────────────────────────────────────┐
│ func.next_day(func.to_date('2024-11-13'), 'monday') │
├──────────────────────────────────────────────────────┤
│ 2024-11-18 │
└──────────────────────────────────────────────────────┘
SQL Syntax
NEXT_DAY(<date_expression>, <target_day>)
| Parameter | Description |
|---|---|
<date_expression> | A DATE or TIMESTAMP value to calculate the next occurrence of the specified day. |
<target_day> | The target day of the week to find the next occurrence of. Accepted values include monday, tuesday, wednesday, thursday, friday, saturday, and sunday. |
Return Type
Date.
SQL Examples
To find the next Monday after a specific date, such as 2024-11-13:
SELECT NEXT_DAY(to_date('2024-11-13'), monday) AS next_monday;
┌─────────────┐
│ next_monday │
├─────────────┤
│ 2024-11-18 │
└─────────────┘