DAY_CEIL
説明
日付を指定された時間間隔期間の最も近い上位の値に切り上げます。
構文
DAY_CEIL(<datetime>)
DAY_CEIL(<datetime>, <origin>)
DAY_CEIL(<datetime>, <period>)
DAY_CEIL(<datetime>, <period>, <origin>)
パラメータ
| Parameter | デスクリプション |
|---|---|
<datetime> | 有効な日付式 |
<period> | 各期間を構成する日数を指定 |
<origin> | 時間の開始点。指定されない場合、デフォルトは0001-01-01T00:00:00 |
Return Value
最も近い切り上げされたタイムスタンプの日付を返します。
Examples
select day_ceil("2023-07-13 22:28:18", 5);
+-----------------------------------------------------------+
| day_ceil(cast('2023-07-13 22:28:18' as DATETIMEV2(0)), 5) |
+-----------------------------------------------------------+
| 2023-07-17 00:00:00 |
+-----------------------------------------------------------+