コンテンツにスキップ

指定した日付またはタイムスタンプより後で、次に来る指定した曜日の日付を返します。

func.next_day(date_expression>, <target_day>)
func.next_day(func.to_date('2024-11-13'), 'monday')
┌──────────────────────────────────────────────────────┐
│ func.next_day(func.to_date('2024-11-13'), 'monday') │
├──────────────────────────────────────────────────────┤
│ 2024-11-18 │
└──────────────────────────────────────────────────────┘
NEXT_DAY(<date_expression>, <target_day>)
パラメーター 説明
<date_expression> 指定した曜日が次に来る日付を計算する対象の DATE または TIMESTAMP の値です。
<target_day> 次の該当日を求める対象の曜日です。指定できる値は monday、tuesday、wednesday、thursday、friday、saturday、sunday です。

日付。

特定の日付(たとえば 2024-11-13)の次の月曜日を求めるには、次のようにします。

SELECT NEXT_DAY(to_date('2024-11-13'), monday) AS next_monday;
┌─────────────┐
│ next_monday │
├─────────────┤
│ 2024-11-18 │
└─────────────┘